Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing a validator with jQuery

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.

like image 475
Scott Avatar asked Feb 11 '11 16:02

Scott


1 Answers

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

$('#zipcode').rules('remove', 'validate_zipcode');
like image 64
Vadim Avatar answered Nov 12 '22 00:11

Vadim