LP#1847343: fix Exclude Electronic Resources checkbox when locale picker is enabled
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 8 Oct 2019 23:00:12 +0000 (16:00 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 31 Jul 2020 21:39:35 +0000 (17:39 -0400)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/web/js/ui/default/opac/simple.js

index e121fd1..abf50c7 100644 (file)
@@ -108,11 +108,9 @@ function exclude_onchange(checkbox) {
         var reg = /-search_format\(electronic\)/g;
         search_box.value = search_box.value.replace(reg, "");
         // Remove from the search form itself
-        var search_format_inputs = document.getElementsByName("fi:-search_format");
+        var search_format_inputs = document.querySelectorAll('input[type="hidden"][name="fi:-search_format"][value="electronic"]');
         for (var j = 0; j < search_format_inputs.length; j++) {
-            if (search_format_inputs[j].value == 'electronic') {
-                search_format_inputs[j].parentNode.removeChild(search_format_inputs[j]);
-            }
+            search_format_inputs[j].parentNode.removeChild(search_format_inputs[j]);
         }
 
     }