patch from Bill Ott for a form-reset button to clear the advanced search inputs....
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Jun 2008 13:10:56 +0000 (13:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Jun 2008 13:10:56 +0000 (13:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9867 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/js/adv_global.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml

index 5993c9e..a2d4f2e 100644 (file)
@@ -443,6 +443,7 @@ Please see a librarian to renew your account.">
 <!ENTITY advanced.search.title "Search Input">
 <!ENTITY advanced.add.row "Add Search Row">
 <!ENTITY advanced.search.submit "Submit Search">
+<!ENTITY advanced.search.reset "Reset Form">
 <!ENTITY advanced.search.filters "Search Filters">
 <!ENTITY advanced.item.form "Item Form">
 <!ENTITY advanced.item.type "Item Type">
index 78f1746..3e93f52 100644 (file)
@@ -70,7 +70,7 @@ function advSyncCopyLocLink(org) {
 
 }
 
-function initSearchBoxes() {
+function initSearchBoxes(clean) {
     /* loads the compiled search from the search cookie 
         and sets the widgets accordingly */
 
@@ -88,6 +88,15 @@ function initSearchBoxes() {
         advAddGblRow();
 
     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 95daf0b..20b9240 100644 (file)
@@ -33,6 +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 id='myopac_new_global_row' onclick='advAddGblRow();'>&advanced.add.row;</button>
                                                        <span style='padding-left: 10px;'> </span>
                             <button onclick='advSubmitGlobal();'>&advanced.search.submit;</button>