From: Owen Leonard Date: Wed, 6 Mar 2019 18:41:12 +0000 (+0000) Subject: Bug 15911: (follow-up) Allow enter to submit using the submit button X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=2aa868bad2ecc819fc3878d04e65bb04045c4daa;hp=1af8ab1fc73030f903351c0e097ed73f1f869256;p=koha.git Bug 15911: (follow-up) Allow enter to submit using the submit button This patch modifies the checkEnter function so that it is possible to submit a form by tabbing to the submit button and hitting ENTER to submit. Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index dc7f32e690..d86b994f1f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -128,8 +128,10 @@ function checkEnter(e){ //e is event object passed from function invocation } else { characterCode = e.keyCode; //character code is contained in IE's keyCode property } - - if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key) + if( characterCode == 13 //if generated character code is equal to ascii 13 (if enter key) + && e.target.nodeName == "INPUT" + && e.target.type != "submit" // Allow enter to submit using the submit button + ){ return false; } else { return true;