modified form clearing to work regardless of propogated search terms
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jul 2008 13:28:59 +0000 (13:28 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jul 2008 13:28:59 +0000 (13:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10069 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/adv_global.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml

index 11beca3..7f2b2a3 100644 (file)
@@ -69,7 +69,19 @@ function advSyncCopyLocLink(org) {
 
 }
 
-function initSearchBoxes(clean) {
+function clearSearchBoxes() {
+    var rows = $('adv_global_tbody').getElementsByTagName('tr');
+    for(var t = 0; t < rows.length; t++) {
+        if($n(rows[t], 'term')) {
+            $n(rows[t], 'term').value = '';
+            setSelector($n(rows[t], 'container'), 'contains');
+            setSelector($n(rows[t], 'type'), 'keyword');
+        }
+    }
+}
+
+
+function initSearchBoxes() {
     /* loads the compiled search from the search cookie 
         and sets the widgets accordingly */
 
@@ -88,14 +100,6 @@ function initSearchBoxes(clean) {
 
     var rows = $('adv_global_tbody').getElementsByTagName('tr');
 
-    if(clean) {
-        for(var t = 0; t < rows.length; t++) {
-            var input = $n(rows[t], 'term');
-            if(input) input.value = '';
-        }
-        return;
-    }
-
     for(var t = 0; t < types.length; t++) {
         var row = rows[t];
         setSelector($n(row, 'type'), types[t]);
index 33c589d..437f321 100644 (file)
@@ -33,8 +33,8 @@
                                        <!-- add a new row -->
                                        <tr id='adv_global_addrow'>
                                                <td align='center'>
-                            <button onclick='initSearchBoxes(1);'>&advanced.search.reset;</button>
-                                                       <span style='padding-left: 10px;'> </span>
+                            <button onclick='clearSearchBoxes();'>&advanced.search.reset;</button>
+                            <span style='padding-left: 10px;'> </span>
                                                        <button id='myopac_new_global_row' onclick='advAddGblRow();'>&advanced.add.row;</button>
                                                        <span style='padding-left: 10px;'> </span>
                             <button onclick='advSubmitGlobal();'>&advanced.search.submit;</button>