问题
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:
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.
来源:https://stackoverflow.com/questions/5725584/jquery-validation-depends