diff --git a/static/app.js b/static/app.js index 49d43ec..c9eba3a 100644 --- a/static/app.js +++ b/static/app.js @@ -80,11 +80,12 @@ function renderTable() { let value = e.target.value; // Only allow plain text, disallow HTML/script tags, max 50 chars if (//.test(value) || /["'`\\]/.test(value)) { - alert('Guest name cannot contain code or special characters like <, >, ", \\', or backticks.'); + alert("Guest name cannot contain code or special characters like <, >, \", \\\\, or backticks."); guestNameInput.value = data.guestNames[date] || ''; return; } - if (!/^([\p{L}\p{N}\s\-\.]+)$/u.test(value)) { + // Only allow a-z, A-Z, 0-9, spaces, hyphens, periods + if (!/^([a-zA-Z0-9 .-]+)$/.test(value)) { alert('Guest name can only contain letters, numbers, spaces, hyphens, and periods.'); guestNameInput.value = data.guestNames[date] || ''; return;