fix: Update phone input validation pattern

This commit is contained in:
Derek L. Seitz 2025-08-17 20:00:58 -05:00
parent 628df8cb2b
commit d665e1f03a
1 changed files with 2 additions and 2 deletions

View File

@ -88,9 +88,9 @@ form.addEventListener("submit", function(event) {
} }
// Phone — match format: 123-456-7890 // Phone — match format: 123-456-7890
const phonePattern = /^\d{3}-\d{3}-\d{4}$/; const phonePattern = /^(\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4})$/;
if (!phonePattern.test(phone)) { if (!phonePattern.test(phone)) {
showError("phone", "Phone number must be in the format 123-456-7890."); showError("phone", "Phone number format is invalid.");
hasErrors = true; hasErrors = true;
} }