diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 4af3a6f45e..1de62dd3f5 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -511,6 +511,10 @@ function insertConfirmButton(options) { */ function submitFormData(fields, options) { + // Immediately disable the "submit" button, + // to prevent the form being submitted multiple times! + $(options.modal).find('#modal-form-submit').prop('disabled', true); + // Form data to be uploaded to the server // Only used if file / image upload is required var form_data = new FormData(); @@ -778,6 +782,9 @@ function clearFormErrors(options) { */ function handleFormErrors(errors, fields, options) { + // Reset the status of the "submit" button + $(options.modal).find('#modal-form-submit').prop('disabled', false); + // Remove any existing error messages from the form clearFormErrors(options);