mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Pressing enter on a modal form now does the right thing
This commit is contained in:
parent
37b109b8fc
commit
b2bb1ea1fe
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user