views:

25

answers:

1

Is there anyway to exclude an element from the tab order of a HTML form.

So if i have the following

<input type=text name=username>
<input type=text name=password>
<input type=button name=forgotpassword>
<input type=submit name=login>

I'm aware that I can use tabindex as 1,2,3,4 but i don't want to have to number all the fields. My application is dynamically creating the fields.

Thanks

Jason

+3  A: 

Setting the tabindex to -1 will render an element untabbable (if that's a word) :)

<input type="text" name="username" tabindex="-1" />
Marko
Really? It's not only not a valid HTML attribute, even when specified as a CSS property, it doesn't work in the major browsers. Where did you learn about this? :)
BalusC
I think you mean to say tabindex there :)
tandu
Oooops! I meant tabindex!! :)
Marko
That's better. Have a nice weekend :)
BalusC
@BalusC: Thanks, you too mate :)
Marko
Excellent, that's exactly what i wanted.
Jason
don't you hate it that when you press enter it adds your comment and sometimes you haven't finished typing? and then when you try to type more it says you have to wait 15 seconds
Jason