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

setting focus on a form field using javascript

From: Antony Tennant <antonytennant@yahoo.co.uk>
Date: Fri, 6 May 2005 10:18:36 +0100 (BST)
Message-ID: <20050506091836.27240.qmail@web86903.mail.ukl.yahoo.com>
To: w3c-wai-ig@w3.org
Hi all,
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.
I see 2 sides to the argument as to wether this should be done. 
Using an example of  logon pages:-
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.
The other side to the argument is that users should be left to move logically through the page as dictated by the logical flow of the design of the page.
To actually do this I am using javascript (which I know makes most people frown) however because the page is still usable with javascript disabled I see this as an occasion when javascript can be used.
I would like to know your thoughts on the use of this technique and the level of DDA compliance assuming all html is correct, heading, labels etc.

 Yahoo! Messenger  - want a free & easy way to contact your friends online?  
Received on Friday, 6 May 2005 09:18:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:36:25 UTC