kcls / tpac 2.2 : focus searchbox on home page
authorBill Erickson <berick@esilibrary.com>
Tue, 5 Jun 2012 15:24:56 +0000 (11:24 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 26 Jul 2012 12:45:37 +0000 (08:45 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates_kcls/opac/parts/searchbar.tt2

index 8b08913..b968540 100644 (file)
@@ -27,6 +27,9 @@
                         onfocus="if (this.value=='[% placeholder %]'){this.value='';this.style.color='#000';}"
                         onblur="if (this.value==''){this.value='[% placeholder %]';this.style.color='#999';}"
                         x-webkit-speech />
+
+                    <!-- should be the only element in the page receiving focus.  No onload required. -->
+                    <script>document.getElementById('search_box').focus()</script>
                 </div>
                 <input name='page' type='hidden' value="0" />
             </td>