Using jquery validate() while at the same time having a submit handler
<p>I make an ajax call and return some JSON when my user submits a form which is part of my .submit() handler.</p>

<p>I am also trying to attach some validation to this form now.</p>

<p>The result I am getting with the below code is that I do receive the "Field is required" error message, but the form is being submitted anyway.</p>

<pre><code>// attaching some validation to our form.
$("#myForm").validate();

// submit our form and do stuff
$("#myForm").submit( function(){

// I have an ajax request I need to make here, not relevant for the example.

});

&lt;form id="myForm"&gt;

Foo: &lt;input type="text" name="foo" id="foo" class="required" /&gt;

&lt;/form&gt;
</code></pre>
