Validate File Type of Form

Results 1 to 2 of 2

Thread: Validate File Type of Form

  1. #1
    Join Date
    Dec 1969

    Default Validate File Type of Form

    I am trying to require that at least one file be uploaded but frontpage validation does not work and a normal validation for some reason is not working either. I am using a standard SA-Fileup sample upload file and here is my script<BR><BR>&#060;script&#062;<BR><BR>function validate(form) {<BR><BR> if (form.FILE8.value == "") {<BR> alert("Please enter at least 1 File");<BR> form.FILE8.focus()<BR> return false; }<BR> <BR> }<BR>&#060;/script&#062;<BR><BR>&#060;form name="form" ACTION="step5.asp" ENCTYPE="MULTIPART/FORM-DATA" METHOD="POST"&#062;<BR><BR><BR>&#060;input TYPE="FILE" NAME="FILE8" size="25"&#062;<BR><BR>Am I missing Something, it is displaying the pop up saying "Please enter at least 1 File" but it is also submitting the form, how do I get it to not submit the form?

  2. #2
    Join Date
    Dec 1969

    Default RE: Validate File Type of Form

    you CANNOT access file elements client-side. It&#039;s a security restriction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts