I’m using jQuery as the validation tool for all of my forms and I have a request to limit the length of the inputs on one field to 8, 12, or 13 characters only. Now, I’m already doing minlength: 8, and maxlength: 13 to take care of the upper and lower limits but haven’t figured out how to limit the entry to exactly one of the three lengths.
Share
You could add a custom validation method.
Here is some rough code to get you started:
You could then hook up the validation like this: