Please take a look at the form on this page:
http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/
This form allows you to upload multiple files with just one input element. When you select a file the name of the file apears below with a delete button. You can use the delete button to delete file that you do not want to upload. What I want to do is first display the delete button and then the name of the file. But I don’t know how to do this. I think the code below is the code that displays the filename and button. Can someone help me out?
this.addListRow = function( element ){
// Row div
var new_row = document.createElement( 'div' );
// Delete button
var new_row_button = document.createElement( 'input' );
new_row_button.type = 'button';
new_row_button.value = 'Delete';
// References
new_row.element = element;
// Delete function
new_row_button.onclick= function(){
// Remove element from form
this.parentNode.element.parentNode.removeChild( this.parentNode.element );
// Remove this row from the list
this.parentNode.parentNode.removeChild( this.parentNode );
// Decrement counter
this.parentNode.element.multi_selector.count--;
// Re-enable input element (if it's disabled)
this.parentNode.element.multi_selector.current_element.disabled = false;
// Appease Safari
// without it Safari wants to reload the browser window
// which nixes your already queued uploads
return false;
};
// Set row value
new_row.innerHTML = element.value;
// Add button
new_row.appendChild( new_row_button );
// Add it to the list
this.list_target.appendChild( new_row );
};