开发者

Jquery validate (active/inactive)

I'm using jquery validate plugin to control a form.

My question is how can I activate or deactivate the validate plugin through a checkbox or radio buttons? The form in default mode is controlled 开发者_Python百科by the plugin, and the user has an option to deactivate the form control.

Thanks again for sharing your knowledge!


This should give you all the information you need: Form Validator

But you could make something similar to :

$('#checkBox').change(function() {
    if ($('#checkBox').attr('checked')) {
        var validator = $("#myform").validator();
        validator.destroy();
    }
    else
         $("#myform").validator();
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜