Bug 22768: Global search form keyboard navigation broken
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / js / staff-global.js
index b60af5e..70e0551 100644 (file)
@@ -31,7 +31,7 @@ $.fn.tabIndex = function () {
     return $(this).parent().children('div').index(this);
 };
 $.fn.selectTabByID = function (tabID) {
-    $(this).tabs("option", "active", $(tabID).tabIndex());
+    $(this).tabs("option", "active", $( tabID ).tabIndex());
 };
 
  $(document).ready(function() {
@@ -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;