I\'m having trouble with the syntax to get 2 range values on an input field validation.
My form has 2 select fields and one text input field.
If select1 =
Only one will work at any one time.
Because you cannot have the same rule declared twice on the same field. The second will likely over-ride the first.
Also, the way you've written it using the depends
, you're saying you only want the range
rule when the condition is met.
You simply need to use a function to return
the parameter depending on the conditional.
PrepurchasePlotNumber: {
digits: true,
range: function() {
if (($("#PrepurchasePlotArea").val() == "1") && ($("#PrepurchasePlotRow").val() == "A")) {
return [1, 120]
} else {
return [121, 500]
}
},
....
Modify logic as needed.