Jquery Validation Central Message Many Errors
- by Iamjon
Hi everyone,
I have a form that is being valdated with the Jquery Validation Plugin.
I have managed to get a centeral message "Please Recheck the form", and to have the input focus on the first error. To get this, I had to override the default message of each of the errors.
I was wondering if anyone could help me figure out how I can have it display the error message associated with the first error input instead of a general error message. Here is the code:
$("#Help-A-Noobie-Form" ).validate({
invalidHandler: function(form, validator) {
$(this).find(":input.error:first").focus();
var message = 'Please Recheck The Form' ;
$("#Help-A-Noobie-Form #Message p").addClass('red').html(message);
},
showErrors: function(errorMap, errorList) {
this.defaultShowErrors();
},
rules: {
required:true,
email: {email:true},
phone: {digits:true}
},
messages: {
email: "",
phone: "",
lastname: "",
firstname: "",
required:""
}
})