diff --git a/InvenTree/static/script/modal_form.js b/InvenTree/static/script/modal_form.js index a1c4386048..8bb439cc09 100644 --- a/InvenTree/static/script/modal_form.js +++ b/InvenTree/static/script/modal_form.js @@ -103,6 +103,17 @@ function launchModalForm(modal, url, options = {}) { $(modal + ' .modal-form-content').scrollTop(0); }); + // Prevent 'enter' key from submitting the form using the normal method + $(modal).on('keydown', '.js-modal-form', function(event) { + if (event.keyCode == 13) { + event.preventDefault(); + + $(modal).find("#modal-form-submit").click(); + + return false; + } + }); + ajax_data = { url: url, type: 'get',