title: submitting a form using jquery on jquery ui dialog close function
body: <p>I have a button on my jquery ui dialog like this:</p>
  
  <pre><code>&lt;div id="dialog-confirm" title="Multiple Account Login" style="display: none;"&gt;
       &lt;a class="close-btn" href="#" id="A16"&gt;
                  &lt;img src="../../Content/NewDesign/images/cross.png" width="28" height="28" alt="close dialog" onclick="closeMultipleAccountDialog();" /&gt;&lt;/a&gt;
              &lt;div class="clear-n"&gt;
              &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This buttons when clicked calls a function</p>
  
  <pre><code>    function closeMultipleAccountDialog() {
          $("#hdfAccount").val("cancel");
          $("#hdPage").val("151API");
          $("#hdID").val($("#ID").val());
          $("#hdPSSWD").val($("#PSSWD").val());
          $("#hdACCID").val($("#ACCID").val());
          $("#hdPASSWDINT").val($("#PASSWDINT").val());
          $("#frmsetAccount").submit();
          $(this).dialog("close");        
       }
  </code></pre>
  
  <p>This function need to submit  a form :</p>
  
  <pre><code>      &lt;form action="../Account/SetAccount" method="post" id="frmsetAccount"&gt;
                              &lt;div class="flds-up"&gt;
                                  &lt;div class="lft-txt"&gt;
                                      Account &lt;span&gt;:&lt;/span&gt;&lt;/div&gt;
                                  &lt;div class="user-fld"&gt;
                                      &lt;%=  ViewData["MyAccountsList"] %&gt;
                                  &lt;/div&gt;
                                  &lt;div class="clear-n"&gt;
                                  &lt;/div&gt;
                                  &lt;input type="hidden" id="hdfAccount" name="hdfAccount" value="" /&gt;
                                  &lt;input type="hidden" id="hdPage" name="hdPage" value="" /&gt;
                                  &lt;input type="hidden" id="hdID" name="hdID" value="" /&gt;
                                  &lt;input type="hidden" id="hdPSSWD" name="hdPSSWD" value="" /&gt;
                                  &lt;input type="hidden" id="hdACCID" name="hdACCID" value="" /&gt;
                                  &lt;input type="hidden" id="hdPASSWDINT" name="hdPASSWDINT" value="" /&gt;
                              &lt;/form&gt;
  
  and dialog code is like this:
  
  $("#dialog-confirm").dialog({
                  autoOpen: true,
                  resizable: true,
                  modal: true,
                  width: 458,
                  Height: 184,
  
                  buttons: {
                      "Login": function () {
                          $(this).dialog("close");
                          $("#hdfAccount").val("login");
                          $("#hdPage").val("151API");
                          $("#hdPage").val("151API");
                          $("#hdID").val($("#ID").val());
                          $("#hdPSSWD").val($("#PSSWD").val());
                          $("#hdACCID").val($("#ACCID").val());
                          $("#hdPASSWDINT").val($("#PASSWDINT").val());
                          $("#frmsetAccount").submit();
                      }                   
                  },
                  open: function (event) {
                      $('.ui-dialog-buttonpane').find('button:contains("Login")').focus();
                      $('.ui-dialog-buttonpane').find('button:contains("Login")').addClass('customokbutton');
                  },
                  close: function (event) {
                      closeMultipleAccountDialog();
                  }
              });
  </code></pre>
  
  <p>It works on login button and form is submitted but not on Dialog close. Please suggest me a solution to this.</p>