0

I have a form generated via PHP with input text fields, an input file field, and a submit button. The input text fields are validated via JQUERY attached to the submit button.

I can validate the input text via the JQUERY OR I can process the input field on post with the $_FILES array and move_uploaded_file function. However I cannot do both at once because if I specify an action for the posted form the JQUERY does not get executed.

I have also tried processing the input file in a second PHP script fired from the JQUERY via ajax. However, the $_FILES array no longer has the data.

I’ve searched high and low and tried several possibilities offered in stackoverflow and elsewhere. I can’t find a solution that works even though this cannot be an unusual situation.

Daniel Gimenez
  • 18,530
  • 3
  • 50
  • 70
  • http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery – Musa Jul 28 '13 at 21:36
  • I like this plugin https://github.com/malsup/form/ it will allow you to do your JS validation `beforeSubmit` BUT always remember to have server side validation as well. – cmorrissey Jul 28 '13 at 21:45

0 Answers0