title: Ajax.BeginForm show loadingElementId when OnBegin return false
body: <p>Hello I'm having the same problem from this post: </p>
  
  <p><a href="https://stackoverflow.com/questions/1164251/ajax-beginform-not-hiding-loading-element-when-onbegin-fails">Ajax.BeginForm not hiding loading element when onBegin fails</a> but I have not found how to solve it yet.</p>
  
  <p>Basically when I use Ajax.BeginForm with a OnBegin function and this function returns false, the loading elementID is still shown and it never hides again.</p>
  
  <p>This is the code I'm testing it with:</p>
  
  <pre><code>function isValid() {
      return false
  } 
  
  
  &lt;% using (Ajax.BeginForm("LogIn", "Security", new { ReturnUrl = Request["ReturnUrl"] }
         , new AjaxOptions { UpdateTargetId = "resultErrors", OnBegin = "isValid", LoadingElementId = "updatePanel" }))
  { %&gt;
  </code></pre>