I'm using jQuery Validate, but I really don't want to have any error messages whatsoever. Rather, I need to have red boxes around offending inputs/selects/etc. These red boxes were a piece of cake to add, but I still cannot remove error messages themselves. How do I disable them altogether?
+5
A:
Use a custom error placement function (see the plugin's options) that doesn't append the error message to anything.
$('#form').validate({
errorPlacement: function(error,element) {
return true;
}
});
Or you could put the error messages elsewhere on the page - say in a DIV at the top of the page.
tvanfosson
2009-10-16 13:35:21
Thanks, found this answer while having the same problem :)
Agos
2010-07-15 13:00:02
+1
A:
You can override the showErrors
function:
jQuery('form').validate({
showErrors: function(errorMap, errorList) {
// Do nothing here
},
onfocusout: false,
onkeyup: false,
rules: {
email: {
required: true
}
},
messages: {
email: {
required: 'The email is required'
}
}
});
Darin Dimitrov
2009-10-16 13:36:33