diff options
Diffstat (limited to 'fg21sim/webui')
-rw-r--r-- | fg21sim/webui/static/js/main.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fg21sim/webui/static/js/main.js b/fg21sim/webui/static/js/main.js index dc471dc..f0755c2 100644 --- a/fg21sim/webui/static/js/main.js +++ b/fg21sim/webui/static/js/main.js @@ -249,4 +249,13 @@ $(document).ready(function () { var body = toggle.closest(".panel").find(".panel-body"); toggleBlock(toggle, body); }); + + // Prevent from submitting form by "Enter" + // Credit; https://stackoverflow.com/a/11235672/4856091 + $("form").on("keypress", function (e) { + if (e.which === 13) { + e.preventDefault(); + return false; + } + }); }); |