title: jquery.validate showErrors() triggered multiple times?
body: <p>In my test program, I use jquery.validate plugin to check user input fields as so:</p>
  
  <pre><code>&lt;script src="js/jquery-1.12.4.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery-form-3.51.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery-validation-1.15.1/jquery.validate.min.js"&gt;&lt;/script&gt;
  
  &lt;form id="form-profile" method="post"&gt;
      &lt;input name="Age" type="text" /&gt;
      &lt;input name="Gender" type="text" /&gt;
      &lt;button type="submit"&gt;submit&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  $(function() {
      setValidateRules();
  });
  
  function setValidateRules() {
      $("#form-profile").validate({
          rules: {
              Age: "required",
              Gender: "required"
          },
          messages: {
              Age: "Please fill in age",
              Gender: "Please fill in gender",
          },
          showErrors: function(errorMap, errorList) {
              alert(JSON.stringify(errorMap));
          }
      });
  }
  
  $("#form-profile").ajaxForm({
      dataType: "json",
      beforeSubmit: function(arr, $form, options) {
          return $("#form-profile").valid();
      },
      error: function(result) {
          // todo
      },
      success: function(result) {
          // todo
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now my problem is, when I run the page via browser, after clicking submit button, the page keeps popping up alert box recursively, which makes me believe that showErrors() handler is called multiple (many many) times.</p>
  
  <p>Is there a way to solve this problem ?</p>
  
  <blockquote>
    <p>updated jsfiddle:</p>
  </blockquote>
  
  <p><a href="https://jsfiddle.net/1nnqf7qs/" rel="nofollow">https://jsfiddle.net/1nnqf7qs/</a></p>