How can you use Javascript to validate an <input type="file".... field. The
code below gets triggered no matter what -- even with a file in the browse
input box.

Any suggestions



<script language="JavaScript">
function validate() {
  if (document.myForm.DirectoryFile.value == ""); {
       alert("Choose the participants.xls file in your computer.");
    return false;
    }
return true;
}


---------------------------------------

<table>
<form action="index.cfm?go=BatchDirectory" method="post"
enctype="multipart/form-data" name="myForm" OnSubmit="return validate();">
    <tr>
         <td><input type="file" name="DirectoryFile" size="36"></td>
    </tr>
    <tr>
        <td><input type="submit" value="submit"></td>
   </tr>
</form>
</table>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to