title: Ajax.BeginForm Confirmation Dialog onBeginForm() before triggering OnSuccessForm()
body: <p>After I have clicked either 'Yes' or 'No' on the confirmation dialog the OnSuccessForm() function does not trigger. Any ideas on how to halt the onBeginForm() before continuing?</p>
  
  <p>My MVC3 Form</p>
  
  <pre><code>@using (Ajax.BeginForm("Edit", @ViewContext.Controller.ValueProvider.GetValue("controller").RawValue, new AjaxOptions
  {
    UpdateTargetId = Model.Title.Replace(" ", "") + "Form",
    InsertionMode = InsertionMode.Replace,
    OnBegin = "onBeginForm",
    OnSuccess = "OnSuccessForm",
    OnFailure = "showFaliure"
  }))
  {
    @Html.ValidationSummary(true)
    @Html.RenderStandardEditor("Edit " + Model.Title)
  }
  </code></pre>
  
  <p>Here is my JavaScript Sample Code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    var confirmation = false;
    function onBeginForm(ajaxContext)
    {
      $.confirm({
      'title': 'Confirmation',
      'message': 'Confirm?',
      'buttons': {
        'Yes': {
          'class': 'cyan',
          'action': function ()
          {
            confirmation = true;
          }
        },
        'No': {
          'class': 'gray',
          'action': function ()
          {
            confirmation = false;
          }
        }
      }
    });
  }
  
  function OnSuccessForm(ajaxContext)
  {
    if (confirmation == true)
    {
      //DO SOMETHING        
    } 
  }
  
  function showFaliure(ajaxContext)
  {
    //THROW ERROR
  }
  
  &lt;/script&gt;
  </code></pre>