Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Created December 27, 2013 17:32
Show Gist options
  • Save JamoCA/8150012 to your computer and use it in GitHub Desktop.
Save JamoCA/8150012 to your computer and use it in GitHub Desktop.
jQuery Validation rule for EIN Tax ID or Social Security Number (SSN) http://jqueryvalidation.org/
jQuery.validator.addMethod("taxid", function(value, element) {
return this.optional(element) || /^(\d{3})-?\d{2}-?\d{4}$/i.test(value) || /^(\d{2})-?\d{7}$/i.test(value)
}, "Invalid Tax ID");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment