I have used javascript to upload more than one file. when user clicks on 'add more' javascript appends new object to older div using innerHTML. Now the problem is if I select a file and then click on "add more" then new file button exist but older selected file removes and two blank file buttons display. I want this old file must be selected when user add new file button.
Below is the code which I have used.
function addNew()
{
var root = document.getElementById('newAds');
newAd = document.createElement('input');
newAd.setAttribute('type', 'file');
newAd.setAttribute('name', 'uploaded[]');
newAd.setAttribute('id', 'uploaded');
newAd.setAttribute('value', '');
newAd.setAttribute('maxlength', '1024');
root.appendChild(newAd);
root.innerHTML += '<br />';
}
If anybody can, Help Plz!!! tnX.