开发者

Removing a validator with jQuery

开发者 https://www.devze.com 2023-02-10 12:23 出处:网络
So开发者_开发技巧 I\'ve added a validator dynamically to my page with the following code: $.validator.unobtrusive.adapters.addBool(\'zipcode\', \'validate_zipcode\');

So开发者_开发技巧 I've added a validator dynamically to my page with the following code:

$.validator.unobtrusive.adapters.addBool('zipcode', 'validate_zipcode');

Is there a way to dynamically remove it? Something like:

$.validator.unobtrusive.adapters.removeBool('zipcode', 'validate_zipcode');

I've searched Google for something like this but can't find any reference to a remove method.


Nothing built in, but you can do it via the jQuery validate API

$('#zipcode').rules('remove', 'validate_zipcode');
0

精彩评论

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