FileUpload.form : FileUpload : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » FileUpload »

 

FileUpload.form







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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» FileUpload