-
2011-09-01
danpritts
Hi,
It would be great if dokuwiki told the web browser to focus the cursor in the text entry box for the search form.
I did this with the two small changes below. It works during a normal "display" but not when redirected to a page after an edit, i'm sure there are other edge cases. it's a big win IMO.
lib/tpl/default/main.php
change <body> to <body onload=“document.dokuwikisearchform.id.focus();”>
inc/template.php
add name=dokuwikisearchform to this line:
print '<form name=dokuwikisearchform action=”'.wl().'” accept-charset=“utf-8” class=“search” id=“dw__search” method=“get”><div class=“no”>';
-
2011-09-01
ach
Giving the focus to something only makes sense if that something is the main tool and/or is used very often. IMHO the search field doesn't fit that requirement.
-
2011-09-05
danpritts
well, the reason i did this was because that is the first thing i always go for.
also/alternately, what is the negative to doing this? a small javascript dependency, and takes the focus away from wherever it would otherwise be. On my browser (chrome) that is nowhere; typing doesn't take me anywhere. Is there somewhere else that focus should usefully go?
-
2011-10-15
ach
Most importantly, the focus in the edit view should be in the main textarea. And when the main action is a form, it should go there as well, of course (login, register, profile, some of the admin interfaces, etc).
You can also get the focus on the search box easily by using the accesskey F. (So, Alt + Shift + F in Chrome.)