<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
<script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
-[% IF use_autosuggest.enabled == "t" AND basic_search != "f"; %]
+[% IF use_autosuggest.enabled == "t" %]
<script type="text/javascript">
dojo.require("openils.widget.AutoSuggest");
/* Set focus, and place the cursor at the end of the input string */
dojo.addOnLoad(function() {
+ [%- IF basic_search != "f"; %]
dijit.byId('search_box').focus();
+ [%- END %]
- var sb_value = dijit.byId('search_box').value;
+ var sb_elem = dijit.byId('search_box');
+ var sb_value;
+
+ if (sb_elem) {
+ sb_value = sb_elem.value;
+ }
/* Dojo won't trigger a change if the value doesn't change */
if (sb_value) {
dijit.byId('search_box').setValue(sb_value + ' ');