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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scubak1w1
    New Member
    • Feb 2008
    • 53

    #1

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

    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_exist s, 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="multip art/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...
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    This has nothing to do with html or css. You need to ask on the javascript board.

    Comment

    • scubak1w1
      New Member
      • Feb 2008
      • 53

      #3
      Originally posted by drhowarddrfine
      This has nothing to do with html or css. You need to ask on the javascript board.
      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...

      Comment

      Working...