title: How to do a Jquery Callback after form submit?
body: <p>I have a simple form with remote=true. </p>
  
  <p>This form is actually on an HTML Dialog, which gets closed as soon as the Submit button is clicked.</p>
  
  <p>Now I need to make some changes on the main HTML page after the form gets submitted successfully. </p>
  
  <p>I tried this using jQuery. But this doesn't ensure that the tasks get performed after some form of response of the form submission.</p>
  
  <pre><code>$("#myform").submit(function(event) {
  
  // do the task here ..
  
  });
  </code></pre>
  
  <p>How do I attach a callback, so that my code gets executed only after the form is successfully submitted? Is there any way to add some .success or .complete callback to the form?</p>