I would normally just do this with a drop down list but the client has requested that it be a text input…
Basically, I’d like to use Jquery validator to check that a user has entered 1 of 50 valid US state abbreviations into a text input box. If not, they’ll get an error. I can’t seem to find a function that does this. Any help is greatly appreciated!
Here’s a validation method you can add for use with jquery validate
First you declare a validator:
Then apply the validator
and in your form you want to add the class to the form element to check
Here’s a working demo