title: getting jsonresult action result in jquery button click
body: <p>I am working on as asp.net MVC 2 application. I have a form like this:</p>
  
  <pre><code>&lt;% using (Html.BeginForm("SaveCallRecording", "Recording", FormMethod.Post, new { id = "frmAddCallRecording", name = "frmAddCallRecording" }))
                             {%&gt;
  
          &lt;tr&gt;
                                      &lt;td&gt;
                                      &lt;/td&gt;
                                      &lt;td&gt;
                                          &lt;input type="button" id="btnCall" title="Call" value="Call" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" /&gt;
                                          &lt;input type="button" id="btnNewCall" title="New Call" value="New Call" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" /&gt;
                                      &lt;/td&gt;
                                  &lt;/tr&gt;
                              &lt;/table&gt;
                              &lt;%} %&gt;
  </code></pre>
  
  <p>I have this in document.ready</p>
  
  <pre><code> $("#btnCall").click(function () {
                  var CallStatus = $("#txtCallStatus").val();
                  if (CallStatus == 'READY') {
                      if ($("#isUniquePassword").is(':checked') &amp;&amp; $("#UniquePassword").val() == '') {
                          $("#dialog-RecipientEmail-error").dialog("open");
                      }
                      else {
                          $.ajax({
                              type: "POST",
                              dataType: "json",
                              url: "/account/getGenericPassword",
                              success: function (data) {
                                  if (data == null || data == "") {
                                      if ($('#isGenericPassword').is(':checked')) {
                                          $("#dialog-add-generic-password").dialog("open");
                                      }
                                  }
                                  else {
                                           $("#frmAddCallRecording").submit();
                                 //after this I want to show alert based on result                                   
                                  }
                              }
                          });
                      } // end of isUniquePassword if
                  } // end of call status if
                  else if (CallStatus == 'NOT SET') {
                      $("#dialog-required-fields").dialog("open");
                  }
              });
  </code></pre>
  
  <p>and controller is like this:</p>
  
  <pre><code>  [Authorize]
          [HttpPost]
          public JsonResult SaveCallRecording(CallRecording recording, FormCollection form)
          {
       return Json("record saved!");
              }
  </code></pre>
  
  <p>After actionresult SaveCallRecording is executed, I want to show success or fail message. How can I do it ? If I try $.ajax, I need to form form data manually using `data: { "item" : "value1" , ....}. I tried using $.post but I need to pass data to it manually as well. If I make btnCall as submit button instead of button, then validation fails. </p>
  
  <p>I want to:</p>
  
  <p>1) Validate form first and show alerts if form is not validated.
  2) post form data to json Action method SaveCallRecording 
  3) Get success or fail message from Action Method and show as alert</p>
  
  <p>Please suggest solution to it.</p>