title: How to close jQuery Dialog within the dialog?
body: <p>How to close jQuery Dialog within the dialog without using the close button?</p>
  
  <p>Inside the Dialog is a simple form request. If a successful submission occurs, then the UI dialog automatically closes and refreshes the parent page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#form-dialog").dialog({
              autoOpen: true,
              modal: true,
              width: 200,
              draggable: true,
              resizable: true
          });
      });
  &lt;/script&gt;
  
  &lt;div id="form-dialog" title="Form Submit"&gt;
      &lt;form action="default.aspx" method="post"&gt;
          &lt;input type="text" name="name" value=" " /&gt;    
          &lt;input type="submit" value="submit" /&gt;
  
          &lt;a href="#" id="btnDone"&gt;CLOSE&lt;/a&gt;
  
          &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $("#btnDone").click(function () {
                  $(this).dialog('close');
              });
          });
          &lt;/script&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>