title: Debug jQuery form validation
body: <p>I have a form that submits to a url using the action attribute <code>&lt;form action='/example/url'&gt;</code>. It uses the jQuery validation plugin.</p>
  
  <pre><code>jQuery("form#page-0").validate({
          ignore: ':hidden'
          ,rules: {"product_id_page-0":{"required":true},"name_f":{"required":true,"regex":["^[^=:&lt;&gt;{}()\"]+$",""]},"name_l":{"required":true,"regex":["^[^=:&lt;&gt;{}()\"]+$",""]},"email":{"required":true,"remote":{"url":"\/premium\/ajax?do=check_uniq_email&amp;_url=L3ByZW1pdW0vbG9naW4\/YW1lbWJlcl9yZWRpcmVjdF91cmw9JTJGcHJlbWl1bSUyRnNpZ251cC5waHA="}},"login":{"required":true,"rangelength":["6","32"],"regex":["^([0-9a-zA-Z_][0-9a-zA-Z_ ]+[0-9a-zA-Z_]|[0-9a-zA-Z_]+)$",""],"remote":{"url":"\/premium\/ajax?do=check_uniq_login"}},"pass":{"required":true,"rangelength":["6","32"]},"_pass":{"required":true}}
          ,messages: {"product_id_page-0":{"required":"Please choose a membership type"},"name_f":{"required":"Please enter your First Name","regex":"Please enter your First Name"},"name_l":{"required":"Please enter your Last Name","regex":"Please enter your Last Name"},"email":{"required":"Please enter valid Email","remote":"--wrong email--"},"login":{"required":"Please enter valid Username. It must contain at least 6 characters","rangelength":"Please enter valid Username. It must contain at least 6 characters","regex":"Username contains invalid characters - please use digits, letters or spaces","remote":"--wrong login--"},"pass":{"required":"Please enter Password","rangelength":"Password must contain at least 6 letters or digits"},"_pass":{"required":"This field is required"}}
          //,debug : true
          ,errorPlacement: function(error, element) {
              error.appendTo( element.parent());
          }
          ,submitHandler: function(form, event){form.submit();}
          // custom validate js code start
  
          ,errorElement: "span"
          // custom validate js code end
      });
  </code></pre>
  
  <p>The problem is that sometimes the form submits to the url before the validator fires. I'm suspicious of <code>submitHandler: function(form, event){form.submit();}</code> because I don't understand what the <code>event</code> parameter is doing. In the documentation for <a href="http://jqueryvalidation.org/validate/#submithandler" rel="nofollow">jquery validation</a> there's no mention of a second parameter.</p>
  
  <p>Any suggestions for debugging the form are also welcome. Variables to log or other ways to view what's happening. I did set <code>debug:true</code> but it doesn't seem to spit any errors to the console.</p>