title: How to hook into error of jQuery validate unobtrusive in MVC 3?
body: <p>Looking for a way to hook into the client side fail condition for the form.</p>
  
  <p>I need to re-enable a submit button if the validation fails so they can try again.</p>
  
  <p>I found the following: <a href="https://stackoverflow.com/questions/5226806/using-unobtrusive-validation-in-asp-net-mvc-3-how-can-i-take-action-when-a-form">Using unobtrusive validation in ASP.NET MVC 3, how can I take action when a form is invalid?</a> which might work but I was hoping to do this from a central place as the form can be submitted from several places.</p>
  
  <p>Update:</p>
  
  <p>This function seems to work well assuming you have an input tag with the class ".goButton".</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      $(".goButton").click(function () {
          if (!$(this).closest("form").valid()) {
              return false;
          }
          $(".goButton").after("Please wait...");
          $(".goButton").hide();
      });
  &lt;/script&gt;
  </code></pre>