mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Merge pull request #4976 from Icinga/do-not-disable-all-inputs-on-form-submit
js: Only disable submit buttons on form submit (cherry picked from commit 96179182e413b5285ad8be00e7124fd278e300c3)
This commit is contained in:
parent
1c90eaf6b5
commit
f5b6ef39df
@ -119,8 +119,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
// otherwise the form is submitted several times by clicking the "Submit" button several times
|
||||
$form.find('input:not(:disabled)').prop('disabled', true);
|
||||
if (typeof $autoSubmittedBy === 'undefined') {
|
||||
// otherwise the form is submitted several times by clicking the "Submit" button several times
|
||||
$form.find('input[type=submit],button[type=submit],button:not([type])').prop('disabled', true);
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
@ -129,8 +129,11 @@
|
||||
|
||||
// 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);
|
||||
if (! $autoSubmittedBy
|
||||
&& ! $form.is('[role="search"]')
|
||||
&& $target.attr('id') === $form.closest('.container').attr('id')
|
||||
) {
|
||||
$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
|
||||
|
Loading…
x
Reference in New Issue
Block a user