Is there a standards-based alternate to tabindex="-1&qu
Moderator: General Moderators
Is there a standards-based alternate to tabindex="-1&qu
Because I hate when my ff validation icon comes up as anything but a checkbox in a green circle 
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Negative tab indices are used by developers to remove form field elements from the tab sequence. Essentially it limits the users tabbing interaction to a select group of form fields. Of course, any user that uses a mouse would still be able to get to the form field, but that is a different, usability type, discussion.
Right or wrong (probably wrong), I have gotten in the habit of using readonly textboxes styled to
look exactly like other plain text on a page so I can not only dynamically update that text via js,
but have it display to the user immediately, as well as being able to post it as a regular form var.
I'm sure there are better ways to do it, but once you get used to something...
Historically I set readonly and tabindex="-1" on these boxes so the user doesn't
end up focusing on one (or editing it) when tabbing through the form.
look exactly like other plain text on a page so I can not only dynamically update that text via js,
but have it display to the user immediately, as well as being able to post it as a regular form var.
I'm sure there are better ways to do it, but once you get used to something...
Historically I set readonly and tabindex="-1" on these boxes so the user doesn't
end up focusing on one (or editing it) when tabbing through the form.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
My typical process is if the user doesn't need to touch it, then there is no use showing it. If it has to be displayed, but still not messed with, I will display it as text instead of a form field element. As a last resort, if I have to show the form field but keep people out of the field, I will set some javascript to immediately change the focus of the field to another field as soon as the field has focus (clicked in or tabbed to). I really don't like relying on the last alternative because of the browser reliance implications.