So I've set up a form that uses the form plugin to upload a file
asynchronously:

<form method="post" enctype="multipart/form-data" action="submit.php"
id="editForm">

[... some fields, etc ...]

<div id="image_update">
<input type="text" id="image_url" name="image_url" />
<input type="file" id="image_upload" name="image_upload" />
<input type="button" value="Upload Image"
onClick="$('#editForm').ajaxSubmit({target: '#image_update',url:
'image_upload.php'}); return false;" />
</div>
<input type="submit" value="Save"/>
</form>


I've been able to get all the PHP scripts working correctly. Here's what
happens and what is confusing the heck out of me.

First, when you click the submit button, it posts the form to "submit.php"
just fine.
Second, when you click the "Upload Image" button, it runs that upload
process correctly.
BUT, when you upload an image and then submit the form, the form gets posted
to the "image_upload.php" script not the form action script to which it's
supposed to post.

I've tried a few event disabling things to try to kill the form plug in when
you click submit, and I've even done a $.post to serialize the form and post
it, and that works, but for this project I need to be able to fire off a
full form post using the submit button.

Help...
-- 
View this message in context: 
http://www.nabble.com/ajaxSubmit-and-Form-Submit-troubles-tp15244594s27240p15244594.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to