Jquery Validate Rules With if Condition
This tutorial is for Jquery Validate Rules With if Condition. How to use the if condition with Jquery Validate Rules. Simple you can if condition apply for you code. here field name is your input name. and required in function call. action is id element to get value is insert return true and jquery validate rules next check.
field_name: {
required : function(element) {
var action = $("#action").val();
if(action == "insert") {
return true;
} else {
return false;
}
}
}