Is there a standards-based alternate to tabindex="-1&qu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
themurph
Forum Commoner
Posts: 76
Joined: Wed Apr 19, 2006 1:56 pm
Contact:

Is there a standards-based alternate to tabindex="-1&qu

Post by themurph »

Because I hate when my ff validation icon comes up as anything but a checkbox in a green circle 8O
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Not that I'm aware of (at least not for HTML). Apparently XHTML allow any value to be entered as a tab index, even strings. But from what I have found through Googling, there doesn't appear to be a compliance confiorming method to achieve a negative tabindex value.
Noobie
Forum Commoner
Posts: 85
Joined: Sun May 15, 2005 11:38 am

Post by Noobie »

Why not just avoid tabindex all together? If your site is logically laid out then they're unecessary and can actually be more of a hindrance to accessibility than a help.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

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.
User avatar
themurph
Forum Commoner
Posts: 76
Joined: Wed Apr 19, 2006 1:56 pm
Contact:

Post by themurph »

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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

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.
Post Reply