469,326 Members | 1,462 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

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 4688
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.