W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2005

Re: setting focus on a form field using javascript

From: David Dorward <david@dorward.me.uk>
Date: Fri, 6 May 2005 10:28:47 +0100
To: w3c-wai-ig@w3.org
Message-ID: <20050506092847.GA30802@us-lot.org>

On Fri, May 06, 2005 at 10:18:36AM +0100, Antony Tennant wrote:
>    I am creating forms over several pages where there is a requirement to put
>    the focus on the first field in the form rather than having the focus
>    remaining on the browser address bar when each page has loaded. 

>    I am aware this technique is used on many site and users are
>    familar with this on various sites they visit.

It is not a technique that I have noticed very often. I can only think
of one site that uses it (I know there are others, but not ones I've
visited enough to stick in my mind).

>    Because the focus is already on the field and you would expect the field
>    to be the focal point of the page for most users, they need only to start
>    typing their username select the go or proceed button and onto the next
>    screen. If focus was not set on this field they need to tab or click the
>    field and then enter their details etc.

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. They could be typing data
into the third (for example) field when the focus is pulled back to
the first, if they don't notice they could easily enter the data they
intended for the third field into the first, and then hit tab and
overwrite the data they entered into the second.

This isn't hypothetical, its happened to be one more then one
occasion, and I've found it very frustrating.

-- 
David Dorward http://dorward.me.uk
Received on Friday, 6 May 2005 09:28:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:21 GMT