-<select class="results_header_sel" id='opac.result.sort' name="sort">
+<select class="results_header_sel" id='opac.result.sort' name="sort"
+ [% IF submit_on_change %]onchange='this.form.submit()'[% END %]>
<option value=''>[% l("Sort by Relevance") %]</option>
<optgroup label='[% l("Sort by Title") %]'>
<option value='titlesort'[% value == 'titlesort' ? ' selected="selected"' : '' %]>[% l("Title: A to Z") %]</option>
[% END %]
<div class="results_header_div"></div>
<div class="results_header_lbl">[% l('Sort by') %]</div>
- [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') %]
+ [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
<div class="results_header_div"></div>
<div class='results_header_sel' id='simple-detail-view-links'>
<div class="results_header_div"></div>
<input type="checkbox" id="limit_to_available" name="modifier" value="available"
- onchange="avail_change_adv_search(this)"
+ onchange="limit_to_avail_onchange(this, true)"
[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
<label for="limit_to_available" class="results_header_lbl">
}
function print_node(node_id) {
var iframe = document.createElement("iframe");
- var source_node = document.getElementById(node_id);
+ var source_node = $(node_id);
source_node.parentNode.appendChild(iframe);
var iwin = iframe.contentWindow;
}
}
}
-function avail_change_adv_search(checkbox) {
+
+function limit_to_avail_onchange(checkbox, submitOnChange) {
if (checkbox.form._adv && !checkbox.checked) {
- var search_box = document.getElementById("search_box");
+ var search_box = $('search_box');
search_box.value = search_box.value.replace(/#available ?/g, "");
}
+
+ if (submitOnChange) {
+ checkbox.form.submit();
+ }
}