title: Is there a good way to deal with unobtrusive validation's seemingly asynchronous behavior?
body: <p>I have the below abbreviated validation code running on the submit of a form. Unobtrusive validation is set up for my form.</p>
  
  <pre class="lang-js prettyprint-override"><code>(function () {
      "use strict";
  
      $("#feedbackForm").submit(function () {
          var t = $(this).serialize();
          var val = $(this).validate();
          console.log(val.errorList.length);
          return false;
      });
  })();
  </code></pre>
  
  <p>When I hit a breakpoint in Chrome, I see the following behavior:
  <img src="https://i.stack.imgur.com/uRcMv.png" alt="Unobtrusive validation behavior"></p>
  
  <p>You can see from the console that when the code originally executed, it recognized 0 errors in the validation's error list, but when I pause execution via a breakpoint, it recognizes 4 errors in the validation's error list. Also, after the first time, the correct number of errors is correctly calculated at runtime.</p>
  
  <ul>
  <li>How is this possible?</li>
  <li>How can I obtain the correct number of errors at runtime?</li>
  </ul>
  
  <hr>
  
  <h3>Edit 1:</h3>
  
  <p>I can't reproduce this issue on jsfiddle, so there must be something else going on.</p>
  
  <p><a href="http://jsfiddle.net/peter_majeed/xf7K4/1/" rel="nofollow noreferrer" title="JS Fiddle">Fiddle</a></p>
  
  <hr>
  
  <h3>Edit 2:</h3>
  
  <p>I must also note that using <code>setTimeout()</code> within the submit handler gets the correct result on the second time everytime, but this only seems to corroborate what mattytommo mentioned in his answer.</p>