Changing behavior of jQuery Validation plugin
I've been reading the documentation of a jQuery Validation Plugin
and for some reason I couldn't find a way to change the behavior 开发者_运维技巧I'm trying to get it to color the input's background in red, instead of writing
anything.. is there perhaps a similar plugin that does that already?Use highlight and unhighlight
highlight: function (element, errorClass) {
$(element).css({ "background-color": BackgroundColour });
},
unhighlight: function (element, errorClass) {
$(element).css({ "background-color": "#FFFFFF" });
}
These can be added just below rules
You can control anything in the Validation plugin. Search in the API for a callback method called showErrors
. You can use it to customize error rendering
精彩评论