title: how to stop postback or submit event for jQuery Unobtrusive validation
body: <p>I am using jQuery Unobtrusive Validation and want to do few things before I submit the form.
  I dont want to postback the form after successful validation, but instead want to show a success message to user and reset the same form for adding another data.</p>
  
  <p>in the following code, it shows me alert only when form is not valid, if its valid it just do a postback.</p>
  
  <p>Currently my form gets submitted even though I want to avoid postback in this scenario.</p>
  
  <pre><code>@model MyProject.ViewModels.CustomerViewModel
  
  &lt;script src="~/Scripts/jquery.validate.unobtrusive.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function () {
  
      $("#addCustomer").click(function () {
  
          $("#myForm").validate();
  
          if ($("#myForm").valid()) {
  
              // This part doesn't get triggered
  
              alert('yes valid');
              //$.post(...post my data using ajax..)
              alert('data posted successfully.');
              //clear form to submit another data
              clearForm();
              return false;
          }
          else{
              alert('no not valid');
              return false;
          }
  
    &lt;form id="myForm"&gt;
      &lt;div class="formPanel"&gt;
              &lt;label&gt;Display Name&lt;/label&gt;
              @Html.EditorFor(model =&gt; model.CustomerName)
              @Html.ValidationMessageFor(model =&gt; model.CustomerName)
      &lt;/div&gt;
     &lt;button class="btn btn-primary" id="addCustomer"&gt;Save&lt;/button&gt;
    &lt;/div&gt;
   &lt;/form&gt;
  </code></pre>