From a2579dbd6dcc004895e8bb3c0afdffd04ac78ffb Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sat, 30 Mar 2024 11:30:10 -0600 Subject: [PATCH] Fix form disabling upon submission Turns out if you disable everything then nothing is sent! --- web/src/main/resources/static/js/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/web/src/main/resources/static/js/index.js b/web/src/main/resources/static/js/index.js index 3a49024..1b5c89f 100644 --- a/web/src/main/resources/static/js/index.js +++ b/web/src/main/resources/static/js/index.js @@ -3,9 +3,6 @@ const forms = document.getElementsByTagName('form') for (let i = 0; i < forms.length; i++) { const form = forms[i] form.onsubmit = () => { - const inputs = form.getElementsByTagName('input') - for (let j = 0; j < inputs.length; j++) { - inputs[j].disabled = true - } + form.querySelector('input[type="submit"]').disabled = true } } \ No newline at end of file