title: how can i close my jquery ui dialog when i submit a form?
body: <p>i load a form into a jquery ui dialog.  i have a submit button (<strong>inside my form - NOT the actual dialog buttons</strong>) that calls a controller action but i can't figure out how to close the dialog after the submit is called as i dont have any event handler that i am attaching.  </p>
  
  <p>is there anyway of doing this besides changing the submit to input type=button?</p>
  
  <p>i know in jquery i can capture the submit </p>
  
  <pre><code>$('#positionForm').submit(function () {
      // do stuff
      return true;
  });
  </code></pre>
  
  <p>but this seems to fire before submitting so i dont want to close the dialog yet.</p>
  
  <p>is there anything wrong with the below code:</p>
  
  <pre><code>$('#positionForm').live('submit', function () {
  
      $.post('/MyController/Action', $("#positionForm").serialize(), function (data) {
              alert(data);
      }, "html");
  
      closeModalPopup();
      return false ;
  });
  </code></pre>