Hello, I am using JQuery Validation. Now I want my rules to be invoked only when certain condition is satisfied, namely, I want $("#AppSelectField").is(':hidden')
to return false
, only then I invoke the rules.
My rules is as follow:
$(function() {
$("#RequestLock").validate({
rules: {
FloorNum:{
required: true,
digits: true
},
},
message: {
FloorNum: "The floor number must be integer",
},
});
});
How to modify the above section to satisfy my needs? Note I don't want to write my own custom method for required
and digits
.