我有
$("#myForm").validate({ .... rules: { phone1: { required: { depends: "!#pri_noPhone:checked" },number: true,minlength:3,}
它不会引发错误,但仍会尝试验证电话号码.
>根据规则:我如何确保电子邮件和confirmEmail是相同的?我有规则,信息分开.
"#phone1": { number: true,required: function(element){ return ($('#pri_noPhone_wrapper input:checked').val() == 'True'); } }
HTML(看了之后我忘了添加包装HTML)
<span id='pri_noPhone_wrapper'> Phone: <input type="checkBox" name="pri_noPhone" value="what ever" /> </span>