mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
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:
parent
d3f4ffe35c
commit
7cea0d78e4
@ -120,7 +120,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// otherwise the form is submitted several times by clicking the "Submit" button several times
|
// 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.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
// Disable all form controls to prevent resubmission except for our search input
|
// Disable all form controls to prevent resubmission except for our search input
|
||||||
// Note that disabled form inputs will not be enabled via JavaScript again
|
// 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')) {
|
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
|
// Show a spinner depending on how the form is being submitted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user