fix: corrected Regex pattern for client-side phone input validation

This commit is contained in:
2025-08-18 16:20:10 -05:00
parent d665e1f03a
commit 8a5daaf178

View File

@@ -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;