title: Perform action before form submit?
body: <p>I have this HTML form with an id and I have binded this id to the submit function. What I want is when a user clicks submit, a popup comes up like a modal box thanking them.  And only after they click off the screen or when the modal box closes is when I want the form to submit and refresh the page.</p>
  
  <p>But the way I have it now seems it will refresh no matter what.  I am using the fancy popup plugin for the modal box.</p>
  
  <pre><code>&lt;form action="submit-comment.php" method="post" id="form"&gt;
  &lt;input type="text" name="comment" /&gt;
  &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  
  jQuery("#form").submit(function() {
       jQuery.fancybox('&lt;div class="box"&gt;Some content&lt;/div&gt;', {
             'onClosed' : function() { return true; }
              }     
       });
  });
  </code></pre>
  
  <p>As you can see I am trying to tell it to return true only on close but it isn't really working.</p>
  
  <p>Any ideas?</p>