title: Check for errors in ajax before submit form
body: <pre><code>$(document).ready(function(){
      $("#userid").blur(function(){
          $.post("validation.php?input=userid",{ userid:$("#userid").val() } ,function(data){
              if(data == "blank"){
                  $("#useridError").removeClass().addClass('messageError').html('Please do not leave blank!');
              }
          });
  
      });
  });
  </code></pre>
  
  <p>Hello guys, I have this codes that use jQuery to validate the userid. There will be some more validation for example password, name, etc. But I am so confused. Now I am able to tell the user that the inserted userid contains error. When it comes to posting the form, how could I check the errors? </p>
  
  <p>for example, the userid and name get errors, so when we click submit, the form will not submit. If there is no error displayed, then the form can be submitted.</p>
  
  <p>Thanks in advance!</p>