title: jQuery fadeOut and then submit()
body: <p>This code does not work.
  Fade Out works fine, but form is not submitted.
  What is wrong?</p>
  
  <pre><code>&lt;div id="main_div"&gt;
   &lt;form action="#" method="POST"&gt;
    &lt;input type="text" name="name"&gt;&lt;br&gt;
    &lt;input type="password" name="pass"&gt;&lt;br&gt;
    &lt;input type="submit" name="login" value="Login"&gt;
   &lt;/form&gt;
  &lt;/div&gt;
  
  $("form").submit(function(event) {
    event.preventDefault();
    $("#main_div").fadeOut(1000, function() {
      $("form").submit();
    });
  });
  </code></pre>