[thelist] Autofocus usability issues tackled

Christian Heilmann codepo8 at gmail.com
Mon Oct 9 12:03:12 CDT 2006


I have a pet peeve, which is web sites that automatically focus a
certain form field when the page has loaded. I understand the logic of
it, but more than once I found myself having already typed in half the
email - or, even worse, my password before being forcefully sent back
to the email field and delete what I entered there.

I pondered a bit how to make this functionality a bit more clever and
detect when someone already entered data before trying to focus the
field, mourned the lack of "hasfocus", had some trouble using event
handling until I remembered a lesser used property - defaultValue to
work around the issue.

Whole story and test cases how to not do autofocus and several options
to do it better at
http://www.wait-till-i.com/index.php?p=348

enjoy,
Chris
-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list