By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

FORM: 'onsubmit' js validation not working when enctype="multipart/form-data"

scubak1w1
P: 53
Hello,

I am building a form that collects some data about a file and throws it into a PosgreSQL database and also allows the user to upload and process the file using PHP's $_FILES...

i.e., <input type="file" name="file" id="file" size="50"/>

Action is a PHP_SELF, method is POST, check with array_key_exists, etc... anyway..... :-)

The form works just fine if all of the data is entered correctly...

However, the 'onsubmit' js validation is not 'triggered' when the form's enctype="multipart/form-data" ??

Help! TIA! <smile>

Aside:

- once I get it working, any validation suggestions for the file upload part of the form as I can't check the $_FILES criteria prior to the submit of course

- I previously had it working via two forms - upload, check $_FILES, AJAX to turn on the submit for the details form, details entered, submit, working as desired - but only in IE! (in non-IE browsers, the submit button for the details part of the 2nd form was turned on correctly by AJAX but simply 'ignored' when clicked...)

Cheers!:
GREG...
Mar 13 '09 #1
Share this Question
Share on Google+
2 Replies


drhowarddrfine
Expert 5K+
P: 7,435
This has nothing to do with html or css. You need to ask on the javascript board.
Mar 13 '09 #2

scubak1w1
P: 53
@drhowarddrfine
Or the PHP board? <smile>

I assumed because the elements 'enctype' and 'onsubmit' are HTML, and it was maybe because they were 'clashing' when together in the HTML, but work fine when just one of them, that this seemed the appropriate place...

But I will do as you suggest, thank you...
Mar 13 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.