RE: setting focus on a form field using javascript

> David Dorward

> This can work if there is only one field. If there are more fields,
> then it is quite possible for the user to click on the field and start
> entering data before the JavaScript fires.
[...]
> This isn't hypothetical, its happened to be one more then one
> occasion, and I've found it very frustrating.

Definitely. I get equally annoyed when I do a type-ahead search in Firefox
(I have it set so that I just need to type to start the search, without having
to CTRL+F first) when I get to a page and halfway through my typing the focus
is yanked away from under my feet and the last two or three letters of my
search end up in the input field. I know, a very specific situation, but a real
one nonetheless.

You could argue that if input itself is the main focus of the page (e.g. Google),
then it's acceptable...although you could just ensure that the markup is such
that the input comes first (or at least very early on) so even just tabbing to
it would take a minimal, negligible amount of time and effort.

Patrick
________________________________
Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk

Received on Friday, 6 May 2005 09:36:48 UTC