modal.js: Don't disable inputs before the actual form submit is done

fixes Icinga/icingadb-web#376
This commit is contained in:
Johannes Meyer 2021-09-27 14:09:24 +02:00
parent 8ac8271edd
commit dcf394eaa6
1 changed files with 3 additions and 2 deletions

View File

@ -95,8 +95,6 @@
var _this = event.data.self; var _this = event.data.self;
var $form = $(event.currentTarget).closest('form'); var $form = $(event.currentTarget).closest('form');
var $modal = $form.closest('#modal'); var $modal = $form.closest('#modal');
// otherwise the form is submitted several times by clicking the "Submit" button several times
$form.find('input:not(:disabled)').prop('disabled', true);
var req = _this.icinga.loader.submitForm($form, $autoSubmittedBy); var req = _this.icinga.loader.submitForm($form, $autoSubmittedBy);
req.addToHistory = false; req.addToHistory = false;
@ -107,6 +105,9 @@
} }
}); });
// otherwise the form is submitted several times by clicking the "Submit" button several times
$form.find('input:not(:disabled)').prop('disabled', true);
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
return false; return false;