gpt4 book ai didi

jQuery 验证器解除绑定(bind)

转载 作者:行者123 更新时间:2023-12-03 22:14:17 24 4
gpt4 key购买 nike

我正在使用jQuery Validator 。我试图弄清楚:提交表单后如何从表单中取消附加验证器?

$(function() {
// Just the rules, etc...
validator = $("#sweepstakesForm").validate({rules: {fname: {required: true,minlength: 2,maxlength: 50},lname: {required: true,minlength: 2,maxlength: 50},email: {email: true,remote: "?c=home&m=jsHook&param=email&nojson=1",required: true,minlength: 6,maxlength: 120},address: {required: true,minlength: 5,maxlength: 100},state_0: {required: true},state: ); // etc ...

$('#sweepstakesForm').submit() {

}
});

我已经尝试过这些但没有成功:

validator = null;
$("#sweepstakesForm").unbind('validate');
delete validator;

最佳答案

尝试

$('#sweepstakesForm').data('validator', null);
$("#sweepstakesForm").unbind('validate');

关于jQuery 验证器解除绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9642384/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com