From 8a5daaf1784c920ec70a978baee7a0012239f49e Mon Sep 17 00:00:00 2001 From: dereklseitz Date: Mon, 18 Aug 2025 16:20:10 -0500 Subject: [PATCH] fix: corrected Regex pattern for client-side phone input validation --- src/scripts/contact-form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/contact-form.js b/src/scripts/contact-form.js index f7082af..72f64e7 100644 --- a/src/scripts/contact-form.js +++ b/src/scripts/contact-form.js @@ -88,7 +88,7 @@ form.addEventListener("submit", function(event) { } // Phone — match format: 123-456-7890 - const phonePattern = /^(\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4})$/; + const phonePattern = /^(\(?\d{3}\)?[-.\s]?\d{3}[\-.\s]?\d{4})$/; if (!phonePattern.test(phone)) { showError("phone", "Phone number format is invalid."); hasErrors = true;