Need Help to create dynamic file upload box

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mayankbha
Forum Newbie
Posts: 4
Joined: Sun Nov 28, 2010 8:58 am

Need Help to create dynamic file upload box

Post by mayankbha »

Hello,

I have created a form and on that i have a text box and a button just enter the number of items to add in text box and click on add it will add but now i have a problem that i want to get names of files .

Here is my code:

javascript function:

if(typeof(raju)=='undefined')
{
raju={};
}
raju.Gen=function(count)
{
var div=document.getElementById("MyDiv");
var content="";
for(var i=1;i<=count;i++)
{
var image = "imgnew"+i ;
content+="<br/><input type='file' name=image id='img'+i /><br/>";
}
div.innerHTML=content;
}

Form elements:

<input type="text" name="imgcnt" id="txtCount" onchange="raju.Gen(this.value);" />
<input type="button" id="btnGen" value="Add Upload Images" />

<td id="MyDiv">

</td>

Now i want to take every files by its name but unable to get the names of files.
Post Reply