title: How to fire jQuery function only if form is valid
body: <p>I have a jQuery function tied to my submit button like this:</p>
  
  <pre><code>$(function () {
      $('#signupform').submit(function () {
          alert('test');
      });
  });
  </code></pre>
  
  <p>However, it fires whether or not the form is valid. My model is decorated with various DataAnnotations and the client-side validation is working well, but I only want that jQuery function to fire if the form has been validated. How do I accomplish that?</p>
  
  <p><strong>EDIT:</strong> To clarify, I'm using MVC DataAnnotations + jQuery's unobtrusive javascript to handle the client-side validation. I do not have my own javascript validation routines written. The built in jQuery validation is doing a great job of validating the form, but I just need to know how to get the results of that validation into a boolean value within my own function.</p>