Ezilon.com - Target Your Audience, be Seen in Your Region

Can you control the tab order of form elements?

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 46 posts

Joined: May 2002

Visual Basic programmers can specify the "tab order" of the form elements in their Windows programs.

Can the tab order of form elements on a web page be controlled? How?

Example: I've got a grid of text boxes. 3 across x 4 down = 12 total text boxes. Default tab order is left to right. I want the default tab order to be top to bottom. Can this be done with JavaScript or anything else?

Thanks in advance...

Suzanne's picture

She has: 5,512 posts

Joined: Feb 2000

Yes, you can have it so each tab goes to another field using JavaScript (onfocus, onblur), but in general it's better to design the form so that the natural tabbing is how it happens. If you want two columns, use two forms?

They have: 46 posts

Joined: May 2002

Isn't "onblur" to broad?

I mean, if one textbox has focus, and then I just click somewhere on the screen, won't onBlur force focus to go to the next textbox?

I only want this to happen if someone is in one textbox and specifically presses the "tab" key...

Regarding multiple forms for multiple columns... stuff needs to be aligned horizontally even though tab order needs to work vertically. But thanks for the idea.

Suzanne's picture

She has: 5,512 posts

Joined: Feb 2000

onkeypress?