diff options
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'; + } + }); + } }; |
