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 <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2019-03-06 18:41:12 +00:00 committed by Nick Clemens
parent 1af8ab1fc7
commit 2aa868bad2
1 changed files with 4 additions and 2 deletions

View File

@ -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;