js: Only disable submit buttons on form submit

Previously all `input` elements (text, date, number, ...)
got also disabled. This is unecessary.
This commit is contained in:
Johannes Meyer 2023-01-11 11:37:44 +01:00
parent d3f4ffe35c
commit 7cea0d78e4
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@
});
// otherwise the form is submitted several times by clicking the "Submit" button several times
$form.find('input:not(:disabled)').prop('disabled', true);
$form.find('input[type=submit],button[type=submit],button:not([type])').prop('disabled', true);
event.stopPropagation();
event.preventDefault();

View File

@ -130,7 +130,7 @@
// Disable all form controls to prevent resubmission except for our search input
// Note that disabled form inputs will not be enabled via JavaScript again
if (! $form.is('[role="search"]') && $target.attr('id') === $form.closest('.container').attr('id')) {
$form.find('input:not(:disabled)').prop('disabled', true);
$form.find('input[type=submit],button[type=submit],button:not([type])').prop('disabled', true);
}
// Show a spinner depending on how the form is being submitted