Running is therapy

a blog about running, cats, Linux and programming.
  • Home
  • Current Schedule
  • Personal Records
  • Upcoming Races

little things

Published by Nathan Powell on December 3, 2005 08:55 am under programming

I like to do a couple of things to make a web app a little more usable. The first is to put some thought into the tabindex attribute. I am a tabber when it comes to navigating a form and I love it when the author took the time to make sure I can tab through the fields in a logical sequence. I really hate it when I think I am going to tab to the submit button but instead tab to the “Forgot Password” link…I also have an itchy enter pinky and I usually end up hitting tab->enter too fast to realize the tab took me to the link.

example:

<input type="text" name="firstField" tabindex="1"/>
<input type="text" name="secondField" tabindex="2"/>
 
<input type="submit" value="Submit" tabindex="3" />
<a href="forgotPasswd.html" tabindex="4">Forgot your password?</a>

The second thing I like to do is to put a little JavaScript in there to bring focus to the first field.

example:

function placeCursor() {
   if ( document.NameOfForm ) {
    document.NameOfForm.firstField.focus();
     }
}

I usually put it in the if block so I can just throw it in the JS lib that I import on every page. You can do that without the if block, but then you’ll see an error in the JS Console on other pages (I don’t like that).

Anyhow, I realize these are mundane things and you may already do them. If so skip this post :)

3 Comments so far

  1. Don Spidell on December 5th, 2005

    I also like the the author of a web app has taken the time to have fields with multiple input boxes (like area code + phone or SSN) autotab. Actually, it’d be better if I could just enter my phone number or SSN all in one box each.

  2. Administrator on December 6th, 2005

    Good point. That is excellent. Not so much for me in web apps, but in a GUI app, like a game that makes you enter the serial number, that is a must have. It’s already a pain to type in some random string.

    The advice, I read somewhere, that I like to apply to my code is “Don’t mistreat the user”. And not doing the little things is (in my book) mistreating the user.

  3. Mike on December 18th, 2005

    One of my pet peeves are forms that ask for your address, and then force you to use a drop down list select your state. This means that autofill features don’t work, plus it is a heck of a lot more difficult to get to NY, for instance, that typing two letters.

Posting your comment.

  • Search

  • Archives

    • November 2008 (1)
    • October 2008 (10)
    • September 2008 (4)
    • August 2008 (10)
    • July 2008 (11)
    • June 2008 (14)
    • May 2008 (15)
    • April 2008 (10)
    • March 2008 (16)
    • February 2008 (17)
    • January 2008 (37)
    • December 2007 (21)
    • November 2007 (30)
    • October 2007 (29)
    • September 2007 (22)
    • August 2007 (30)
    • July 2007 (49)
    • June 2007 (32)
    • May 2007 (29)
    • April 2007 (38)
    • March 2007 (26)
    • February 2007 (25)
    • January 2007 (23)
    • December 2006 (10)
    • November 2006 (12)
    • October 2006 (9)
    • September 2006 (9)
    • August 2006 (5)
    • July 2006 (13)
    • June 2006 (9)
    • May 2006 (8)
    • April 2006 (11)
    • March 2006 (12)
    • February 2006 (12)
    • January 2006 (13)
    • December 2005 (15)
    • November 2005 (19)
    • October 2005 (8)
  • Categories

    • blather (64)
    • books (10)
    • computers (177)
    • cooking (1)
    • economics (3)
    • emacs (3)
    • football (1)
    • gaming (1)
    • hiking (5)
    • housekeeping (5)
    • lifehacking (7)
    • music (3)
    • paddling (2)
    • personal (1)
    • politics (21)
    • programming (71)
    • running (236)
    • smoking (40)
    • sysadmin (11)
    • tlc (10)
    • Uncategorized (1)
  • Pages

    • Current Schedule
    • Personal Records
    • Upcoming Races

Copyright © 2008 Running is therapy
WordPress Theme based on Light Theme