enter key on patron search
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 00:06:00 +0000 (00:06 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 00:06:00 +0000 (00:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1526 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form.js

index 448dc5a..6b1fdf5 100644 (file)
@@ -6,6 +6,9 @@ function patron_search_form_init(p) {
 
        p.crazy_search_hash = {}; // hash[ field ] = { 'value' : ???, 'group' : ??? }
 
+       var search_button = p.node.getElementsByAttribute('name','button_search')[0];
+       var clear_button = p.node.getElementsByAttribute('name','button_clear')[0];
+
        var nl = p.node.getElementsByTagName('textbox');
        for (var i = 0; i < nl.length; i++) {
                nl[i].addEventListener(
@@ -17,11 +20,15 @@ function patron_search_form_init(p) {
                                ); 
                        },false
                );
+               nl[i].addEventListener(
+                       'keypress',
+                       function (ev) {
+                               patron_search_form_textbox_handler( ev.target, p.crazy_search_hash );
+                               if ((ev.keyCode == 13)||(ev.keyCode == 77)) search_button.doCommand();
+                       }, false
+               );
        }
 
-       var search_button = p.node.getElementsByAttribute('name','button_search')[0];
-       var clear_button = p.node.getElementsByAttribute('name','button_clear')[0];
-
        p.register_search_callback = function (f) { search_button.addEventListener( 'command',f,false ); };
 
        if (clear_button) {