Add "submit on enter" to all advanced search boxes
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 4 Oct 2011 19:28:36 +0000 (15:28 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 17 Oct 2011 14:19:26 +0000 (10:19 -0400)
Instead of just the one with an ID specified.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/web/opac/skin/default/js/adv_global.js

index 897b1ea..7422e90 100644 (file)
@@ -23,7 +23,13 @@ function advgInit() {
 
        var input = $n($('adv_global_trow'), 'term');
        input.focus();
-       setEnterFunc(input, advSubmitGlobal);
+
+    var rows = $('adv_global_tbody').getElementsByTagName('tr');
+    for(var t = 0; t < rows.length; t++) {
+        if($n(rows[t], 'term')) {
+            setEnterFunc($n(rows[t], 'term'), advSubmitGlobal);
+        }
+    }
 
     if(getSort() && getSortDir()) {
            setSelector($('adv_global_sort_by'), getSort());