[pmwiki-users] cursor on search engine box

DaveG pmwiki at solidgone.com
Mon Feb 13 17:36:03 CST 2012



On 2/13/2012 3:59 PM, fabio wrote:
>
> Hi there,
>
> I've been try to input the cursor into the search engine box when I open the any wiki page (similar to when I open the main Google page - the cursor is there) without success.
>
> I hope you can help me.
You need to add this javascript to your conifg:
<script type="text/javascript">
     window.onload = function() {
         document.forms[0].username.focus();
     }
</script>

Note, that this makes some assumptions about your skin, notably that 
there is only one form on the page, and that it's the form that contains 
the search button.

$HTMLFooterFmt['search-focus']='
<script type="text/javascript">
     window.onload = function() {
         document.forms[0].q.focus();
     }
</script>
';


  ~ ~ David



More information about the pmwiki-users mailing list