- My phone validation depends on a checkbox (no, don t contact me via phone). If this is checked, then I will not need run the phone validation. I googled around and found depends function.
我
$("#myForm").validate({
....
rules: {
phone1: {
required: {
depends: "!#pri_noPhone:checked"
},
number: true,
minlength:3,
}
它没有犯错,但仍试图验证电话号码。
- Under the rules: how do i make sure that email and confirmEmail are the same? 我rules, and messages separate.