Check for file upload on submit

Hi

I currently have a HTML form with a file uplaod field within it, I would like to have a javascript check so that everyone HAS to upload a file to submit the form.

At the moment I have a javascript variable being set to True when the file field changes, and a check for true when it is submitted. But people are still not uploading files. Is there a better way to ensure a file is selected?
logicjbAsked:
Who is Participating?
 
nizsmoConnect With a Mentor DeveloperCommented:
Hi logicjb:

There is no way to check if they have uploaded a file or not, (ie check to see if they have selected a valid upload file) unless this is done using some server-side language, after submission. Is that an option?
0
 
logicjbAuthor Commented:
BTW: There are 3 file fields all named: <input ... name="file[]"> ...

Only one file has to be uploaded
0
 
Computer101Commented:
Forced accept.

Computer101
Community Support Moderator
0
All Courses

From novice to tech pro — start learning today.