471,896 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

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


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>


- 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...)

Mar 13 '09 #1
2 4790
7,435 Expert 4TB
This has nothing to do with html or css. You need to ask on the javascript board.
Mar 13 '09 #2
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.

Similar topics

5 posts views Thread by John Oliver | last post: by
8 posts views Thread by Martin | last post: by
8 posts views Thread by abcd | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.