jQuery validation depends

1.9k Views Asked by At

Is it possible to add a depends onto an equalTo rule?

i.e.,

rule {   
    myFormFierld: if textbox name has been filled out add this equalTo rule..
}
1

There are 1 best solutions below

0
On

The answer is yes. You just need to declare it that way

billingAddress: {
  required:true,
  minlength:5
  equalTo: {
    param: "#shippingaddress",
    depends: "#compare:checked"
  }
}

Simple and beautiful. Via this ticket.