Solved

Check for file upload on submit

Posted on 2007-11-27
4
2,060 Views
Last Modified: 2013-11-19
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?
0
Comment
Question by:logicjb
4 Comments
 

Author Comment

by:logicjb
ID: 20359215
BTW: There are 3 file fields all named: <input ... name="file[]"> ...

Only one file has to be uploaded
0
 
LVL 21

Accepted Solution

by:
nizsmo earned 500 total points
ID: 20360474
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
 
LVL 1

Expert Comment

by:Computer101
ID: 20943720
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery on click requires double click 6 28
How Close unsubmited attempts 10 42
how can i break an array into a couple 5 22
modify change color of text 9 33
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question