How to make custom validators for jQuery validate
Occassionally you need to validate a specific rule in forms. It would be stupid to roll the entire validation library from scratch so instead it’s better to make a custom validator that works with jQuery validate. So, for example, below is a validator that checks that the user didn’t just enter all same characters.
The parameters are:
valueis the value in the input
elemis the input itself
paramis the parameter passed to the validator method when you initialize the validation
Then to use it you can use it as so:
Or send me feedback. It will take less than 20 seconds.