Using jquery validation:
http://docs.jquery.com/Plugins/Validation
I also check every blur field:
$('input, select, radio, checkbox').blur(function(){
$("#createAccount").validate().element(this);
});
I added an additional method for passwords - alpha, number, spaces / dashes:
jQuery.validator.addMethod("passwordCheck", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value);
}, "Invalid characters");
A few problems:
I would like to check the password field for blur for everything except the passwordCheck method. Therefore, other methods, such as those required, should be checked for blur - but if the wrong character is entered, I want the validator to run this method.
In addition, when adding methods, is there a way to get an error message regarding verification request messages (just so that they all are in one place)?
Jason source
share