-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
Hi Everyone,
I wrote a simple validator for US zipcodes. Here it is:
jQuery.validator.addMethod("ZipcodeUS",function(a,b){return this.optional(b)||/\d{5}-\d{4}$|^\d{5}$/.test(a)},"This zipcode is invalid");
All it does is check to make sure that the input is either 5 digits or 5 digits+4 digits.
Metadata
Metadata
Assignees
Labels
No labels