feat: create initial HTML template with responsive table layout for attendance system
This commit is contained in:
parent
89a34bc5c1
commit
27334b46d6
@ -82,9 +82,15 @@ function renderTable() {
|
|||||||
guestNameInput.maxLength = 50;
|
guestNameInput.maxLength = 50;
|
||||||
guestNameInput.onchange = e => {
|
guestNameInput.onchange = e => {
|
||||||
let value = e.target.value;
|
let value = e.target.value;
|
||||||
|
// Allow clearing the guest name (empty string is valid)
|
||||||
|
if (value === "") {
|
||||||
|
delete data.guestNames[date];
|
||||||
|
saveData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Only allow plain text, disallow HTML/script tags, max 50 chars
|
// Only allow plain text, disallow HTML/script tags, max 50 chars
|
||||||
if (/</.test(value) || />/.test(value) || /["'`\\]/.test(value)) {
|
if (/</.test(value) || />/.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] || '';
|
guestNameInput.value = data.guestNames[date] || '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user