Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Second Method of Referencing FileUpload Object Using the forms Elements Array

< html>     <head>     <title>Using form elements array to access FileUpload object</title>     </head>     <body>     <script language="JavaScript">     <!--     function showUploadName(){          alert("The FileUpload box name is: " + document.secret.elements[0].name);     }     -->     </script>     <form name="secret">     Please choose a file to be uploaded.     <br><br>     <input type="file" name="mybox" >     <br><br>     Click the button to get the name of the form containing the FileUpload box.     <br><br>     <input type="button" value="Get Form Name" onClick='showUploadName()'>     </form>     </body>     </html>