View Single Post
  #13 (permalink)  
Old 09-27-06, 06:59 AM
zoliky's Avatar
zoliky zoliky is offline
Aspiring Coder
 
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
I have this HTML form:

Code:
<form name="filesform" action="files.php" method="post" enctype="multipart/form-data">

<table style="margin:1em 0 1em 0">
<tr valign="top" id="fileInput0"  >
<td><b>File 1:</b></td>
<td><input type="file" name="userFile[]" size="20" onkeypress="KeyPress()"  ></td>
</tr>
<tr valign="top" id="fileInput1"  >
<td><b>File 2:</b></td>
<td><input type=file name=userFile[] size=20 onkeypress="KeyPress()"  ></td>
</tr>
<tr valign="top" id="fileInput2"  >
<td><b>File 3:</b></td>

<td><input type=file name=userFile2 size=20 onkeypress="KeyPress()"  ></td>
</tr>
</table>
What I need to do to write each field value in Javascript. I have something like :

Code:
document.write(document.filesform.getElementsByTagName('input').value);
But JavaScript say is undefined. JavaScript need to get the selected file names and print :

file1.exe
file2.exe
file3.exe
Reply With Quote