prevent form from automatically re-submitting on page load
Posted
by user323774
on Stack Overflow
See other posts from Stack Overflow
or by user323774
Published on 2010-04-28T17:36:33Z
Indexed on
2010/04/28
17:47 UTC
Read the original article
Hit count: 182
I am using jQuery to point a form's target to an iframe on .submit(). This is to upload a file. It works fine, but when the page reloads, and the iframe is appended to the DOM, the iframe automatically resubmits the form, causing the same file to be sent to the server on each page load.
If I do not include the iframe in the HTML markup, or do not append it to the DOM, this doesn't happen, but of course, I need the iFrame.
So my question is, how can i prevent this?
:)
Andrew
© Stack Overflow or respective owner