var counter = 0;
function AddFileUpload()
{
var div = document.createElement('DIV');
div.innerHTML = '<input id="file' + counter + '" name = "file' + counter +
'" type="file" />' +
'<input id="Button' + counter + '" type="button" ' +
'value="Remove" onclick = "RemoveFileUpload(this)" />';
document.getElementById("FileUploadContainer").appendChild(div);
counter++;
}
function RemoveFileUpload(div)
{
//here I need to rename my input files because I removed one and get the total count of the uploaded files.
document.getElementById("FileUploadContainer").removeChild(div.parentNode);
}
<table style="width:100%;border:1px solid #eeeeee;background-color:#f5f5f5;">
<tr>
<td align="right" valign="top" style="width:10%;padding-right:5px;"><span style="color:#4a79a5;font-weight:normal;"> <span style="color:#4a79a5;font-weight:normal;"> Click to add files:</span></td>
<td valign="top" colspan="6">
<input id="Button1" type="button" value="add" onclick = "AddFileUpload()" />
<br /><br />
<div id = "FileUploadContainer">
<!--FileUpload Controls will be added here -->
</div>
<br />
</td>
</tr>
</table>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE