title: How check if html5 form validation is complete
body: <p>I have a form which am using html5 to validate for email and required fields.
  The form is to be submitted via ajax.
  How do i determine that the form passed validation before i allow to form to submitted via ajax.</p>
  
  <p>This is my html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="" method="post" id="comment_form"&gt;
    &lt;input type="hidden" name="post_id" value="&lt;?=$post-&gt;ID ?&gt;" /&gt;
    &lt;label for="name"&gt;Name&lt;/label&gt;
    &lt;input type="text" name="name" required="required"&gt;
  
    &lt;label for="email"&gt;Email Address&lt;/label&gt;
    &lt;input type="email" name="email" required="required"&gt;
  
  
    &lt;label for="comment"&gt;Comment&lt;/label&gt;
    &lt;textarea name="comment" required="required" &gt;
    &lt;/textarea&gt;
  
  
    &lt;label for="submit"&gt;&lt;/label&gt;
    &lt;button type="submit"class="button green meduim" id="comment_btn"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  
  
  <p>This is my jquery</p>
  
  <pre class="lang-js prettyprint-override"><code>$("#comment_btn").click(function(e){
    //the request url
    var url = site_url+'comments/post_comment';
    //cross site request forgery token
    var xtoken = $("input[name='xtoken']").val();
    //post data
    var dataObj = {
      "name":$('#name').val(),
      "email":$("#email").val(),
      "comment":$("#comment").val(),
      "post_id":$("input[name='post_id']").val(),
      "xtoken":xtoken
    };
    //dim form
    $('#comment_form').addClass('dim');
    //make request
    $.ajax({
      url:url,
      type:'POST',
      data:dataObj,
      dataType:'json',
      error:function() {},
      success:function(resp) {
        if(resp.status == "ok")
        {
          $('#comment_form').removeClass('dim');
        }else {
          alert("An error was encountered");
        }
      }
    });
    e.preventDefault();
  });
  </code></pre>
  
  <p>Is there a way to determine if the form is validated?</p>