Second Method of Referencing FileUpload Object Using the forms Elements Array : FileUpload : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » FileUpload »

 

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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» FileUpload