diff options
| author | Anjana Vakil <contact@anjana.dev> | 2025-08-27 08:49:51 -0500 |
|---|---|---|
| committer | Anjana Vakil <contact@anjana.dev> | 2025-08-27 08:49:51 -0500 |
| commit | 0a413efa2f7784f176d1ee533d9b404b423713a4 (patch) | |
| tree | 553ef412d606bfbc456374f0b12af3f2311da23e /frontend/src/components/Forms.js | |
| parent | 1dc4f56425209d4ce1d7bb78ec8b5e7b5a755a82 (diff) | |
exercise
Diffstat (limited to 'frontend/src/components/Forms.js')
| -rw-r--r-- | frontend/src/components/Forms.js | 17 |
1 files changed, 8 insertions, 9 deletions
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'; + } + }); + } }; |
