- 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.
I have
$("#myForm").validate({
....
rules: {
phone1: {
required: {
depends: "!#pri_noPhone:checked"
},
number: true,
minlength:3,
}
It doesn't throw an error, but it still tries to validate the phone number.
- Under the rules: how do i make sure that email and confirmEmail are the same? I have rules, and messages separate.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…