Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

FileUpload name

The name property represents the NAME attribute of the HTML tag that creates the FileUpload box. This allows you to reference a FileUpload object directly by name. <html>     <head>     <title> Using the name property of the FileUpload object</title>     </head>     <body>     <script language="JavaScript">     <!--     function getname(){          var boxname = document.form1.myUploadbox.name;          alert("The name of the FileUpload box is: " + boxname);     }     -->     </script>     <form name="form1">     Click on the button below to get the name of the upload box.     <br><br>     <input type="file" name="myUploadbox">     <br><br>     <input type="button" value="Get Name" onClick='getname()'>     </form>     </html>