I use bassistance jQuery validation plugin to validate my inputs.
I want to add a validation method with addMethod. The question is if it’s possible to make this newly added method to be accessible through inputs attributes, like it works for other methods – type=”email”. I don’t want to use it with rules option like this:
rules: {
myField: { lettersonly: true }
}
Please advise.
I’m not sure about input types, but the easiest thing would be to add it using a class, like this:
And this could be your markup:
Then call .validate() method as usual.