2
我的问题很简单:jquery验证插件使用依赖关系并设置参数
如何设置对字段的依赖关系并将params设置为规则函数? 设置参数的关键是什么?
$('#form').validate({
rules: {
somefield: {
minlength: {
depends: function() {
return $('#checkbox').prop('checked');
},
keyToSetParams??: 5
}
}
}
});
没有依赖性,它应该是这样的:
$('#form').validate({
rules: {
somefield: {
minlength: 5
}
}
});
我认为这是不可能的..当我尝试时没有工作。我一定犯了错误:) – MilkyWayJoe 2012-04-26 16:53:25