$(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!');
}
});
});
});
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?
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.
Thanks in advance!
1 Answer