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();
});
精彩评论