I am trying to validate one input. So I wanna to get this kind of rule – if field value is equal to “xxx” (text) then field is valid.
I tried this, but it seems to work only if you want two inputs to be the same.
$("#contact-form").validate({
rules: {
capcode: {
equalTo: "xxx"
}
}
});
Not sure what are you trying to achieve, but you can always add custom validation method:
And then simply use it on your field:
See this DEMO.