FileUpload.form : FileUpload « Form « JavaScript Tutorial






The form property is used to reference the form object that contains the FileUpload box.

<html>
    <head>
    <title>Using FileUpload form property</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function checkFiles(){
         if (document.secret.file1.value == ""){
             alert("You did not enter anything for file 1");
         }
         if (document.secret.file2.value == ""){
             alert("You did not enter anything for file 2");
         }
         else {
              alert("The files are okay and will be uploaded");
         }
    }
    -->
    </script>
    <form name="secret">
    Please choose two files to upload.
    <br><br>
    File 1:<input type="file" name="file1">
    <br><br>
    File 2:<input type="file" name="file2">
    <br><br>
    <input type="button" value="Verify" onClick='checkFiles()'>
    </form>
    </body>
    </html>








10.8.FileUpload
10.8.1.FileUpload
10.8.2.FileUpload.blur()
10.8.3.FileUpload.focus()
10.8.4.FileUpload.form
10.8.5.Second Method of Referencing FileUpload Object Using the forms Elements Array
10.8.6.FileUpload.handleEvent()
10.8.7.FileUpload.name
10.8.8.FileUpload.onBlur
10.8.9.FileUpload.onChange
10.8.10.FileUpload.onFocus
10.8.11.FileUpload.select()
10.8.12.FileUpload.type
10.8.13.FileUpload.value
10.8.14.file Input Element