From 0a413efa2f7784f176d1ee533d9b404b423713a4 Mon Sep 17 00:00:00 2001 From: Anjana Vakil Date: Wed, 27 Aug 2025 08:49:51 -0500 Subject: exercise --- frontend/src/components/Forms.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'frontend/src/components/Forms.js') diff --git a/frontend/src/components/Forms.js b/frontend/src/components/Forms.js index 9a0c087..8e9160f 100644 --- a/frontend/src/components/Forms.js +++ b/frontend/src/components/Forms.js @@ -46,15 +46,14 @@ export const setupForm = (form) => { }); if (btn) { - const inputs = form.querySelectorAll('input.rsvp-email'); - for (let input of inputs) { - input.addEventListener('input', () => { - if (!btn.textContent.startsWith('Submit')) { - btn.removeAttribute('disabled'); - btn.textContent = 'Submit RSVP'; - } - }); - } + const emailInput = form.querySelector('input.rsvp-email'); + emailInput.addEventListener('input', () => { + if (btn.textContent !== 'Submit RSVP') { + btn.removeAttribute('disabled'); + btn.textContent = 'Submit RSVP'; + } + }); + } }; -- cgit v1.3