title: jQuery iframe modal close on form submit
body: <p>I have a jQuery Modal dialog with an iframe in it, the iframe includes a form. When a user submits the form, I would like to close down the modal dialog.</p>
  
  <p>How can I do that?</p>
  
  <p>jquery modal script on index.php:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function showRegDialog(url) {
      $(function() {
              var $this = $(this);
              var horizontalPadding = 30;
              var verticalPadding = 30;
              $('&lt;iframe id="externalSite" scrolling="no" frameborder="0" class="externalSite" src="' + url + '" /&gt;').dialog({
                  title: ($this.attr('title')) ? $this.attr('title') : 'Choose your location',
                  autoOpen: true,
                  width: 700,
                  height: 700,
                  modal: true,
                  resizable: true,
                  autoResize: true,
                  overlay: {
                      opacity: 0.5,
                      background: "black"
                  }
  
              }).width(700 - horizontalPadding).height(700 - verticalPadding);            
  
      });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>link on index.php to call showRegDialog modal:</p>
  
  <pre><code>&lt;a href="javascript:showRegDialog('/register.php');"&gt;Register now&lt;/a&gt;
  </code></pre>
  
  <p>This is the content of the register.php</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="" method="POST"&gt;
  &lt;input type="text"&gt;
  &lt;input type="submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>