开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜