2

I have a form in an iframe and submit it. How can I tell when the submission completes? I'm using jQuery to submit the form but don't think there's a callback:

$("#myForm").submit(); // how to attach event to submission complete?

2 Answers 2

1

Submission of the form will redirect you to the next page.

But you can always try the ajax function

http://api.jquery.com/jQuery.ajax/

Adding callback is as easy as

 $.ajax({
   url: "page.php",
   success: function() {
      doWhateverYouWant();
   }
 });
Sign up to request clarification or add additional context in comments.

Comments

0

If you submit a form, it goes to the next page, so there's nothing else that executes on that page.

2 Comments

If it's in an iframe, the iframe goes to the next page. Therefore, can I detect when the iframe page changes to detect submission completion?
@JQueeeer if it all happens on the same domain, yes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.