Jqueyr upload inside a form

Jqueyr upload inside a form

Hi Jake;

I have been looking for a solution for sometime but no luck.

I have a form that submits data and INSERTs INTO the database. Somewhere in the middle of this form there is another form that uploads photo with Ajax like this: Ajax File Upload.

It is not legal to have nested forms. I end up with something like this:

  1. <form action = "/insert" method = "post">
  2.     <input type = "text" name = "name">
  3.     <form action = "upload_photo/" method = "post" multipart>
  4.         <input type = "FILES" name = "picture">
  5.         <input type = "submit" value = "Upload Picture">
  6.     </form>
  7.     <input type = "submit" value = "Insert data">
  8. </form>
How can I achieve this so the form inside uploads the photo without submitting the whole form?

Thanks Jak