title: ASP.Net MVC 3 Jquery UI Dialog Form
body: <p>I am trying to make a popup dialog to allow the user to fill in a form. 
  When they click submit I want to submit the form.
  I figured out how to make the modal popup but cannot figure out how to get it to submit the form when the form is clicked. Does anyone know how to do this?</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      &lt;div&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Account Information&lt;/legend&gt;
  
              &lt;div class="editor-label"&gt;
                  @Html.LabelFor(m =&gt; m.UserName)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.TextBoxFor(m =&gt; m.UserName)
                  @Html.ValidationMessageFor(m =&gt; m.UserName)
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  @Html.LabelFor(m =&gt; m.Password)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.PasswordFor(m =&gt; m.Password)
                  @Html.ValidationMessageFor(m =&gt; m.Password)
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  @Html.CheckBoxFor(m =&gt; m.RememberMe)
                  @Html.LabelFor(m =&gt; m.RememberMe)
              &lt;/div&gt;
  
              &lt;p&gt;
                  &lt;input type="submit" value="Log On" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
      &lt;/div&gt;
  }
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#dialog-form").dialog({
              modal: true,
              buttons: {
                  "Submit": function () {
                      $(this).dialog("close");
                  },
                  Cancel: function () {
                      $(this).dialog("close");
                  }
              }
          });
      });
  &lt;/script&gt;
  </code></pre>