Skip to content

Commit

Permalink
078-05-1120,219-09-9999 are invalid SSN
Browse files Browse the repository at this point in the history
  • Loading branch information
danielruss committed Sep 15, 2023
1 parent fb4fab4 commit feec784
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ function validate_text(inputElement) {

// validate a SSN...
if (inputElement.classList.contains("SSN")) {
if (!/^(?!9|000|666)(\d)\d{2}-?(?!00)\d{2}-?(?!0000)\d{4}(?<!\1{3}-?\1{2}-?\1{4}?)/.test(inputElement.value)) {
if (!/^(?!9|000|666)(\d)\d{2}-?(?!00)\d{2}-?(?!0000)\d{4}(?<!\1{3}-?\1{2}-?\1{4}?)/.test(inputElement.value) ||
["078-05-1120","219-09-9999"].includes(inputElement.value) ) {
validationError(inputElement, "Please enter a valid Social Security Number in this format: 999-99-9999.")
} else {
clearValidationError(inputElement)
Expand Down

0 comments on commit feec784

Please sign in to comment.