Currently, the HTML generated by Webform does not assign tab indexes to form element; therefore HTML order determines tab order. In some situations it's desirable to assign or override the default tab order.
For instance, in multi-step forms, intermediary pages may have 3 submit buttons, in this order: Save Draft, Previous, Next (or Submit). In such a case it would be better for most users if the 1st button tabbed to was the Next (or Submit) button, as every user will eventually need to use this button, but only some users actually use the Draft or Previous buttons.
Allowing the majority case users to go straight to Next/Submit & skip the unused buttons presents a distinct improvement when filling out the form; other users can simply continue tabbing to reach Draft or Previous.
Adding a feature to assign HTML tab indexes to elements would solve this.
Comments
Comment #1
quicksketchUnfortunately (as you may know), adding a tabindex on any one element immediately means you must set tabindex on *all* elements, otherwise the lowest indexed one will always be first, so there's no half-way ability to just put an index on the buttons and nothing else.
Other problems with tabindex is that it's *per page* (link), if you have multiple forms on the same page, tabindex goes horribly, horribly wrong and starts alternating between forms.
Tabindex also causes problems for keyboard navigation, as it overrides all other natural tab orders on the page (normally it would tab through all the links on the page for example). This can cause some undersirable effects on both usability and accessibility (here's a good blog post detailing the problem).
I've also read up on Form Design in what is pretty much considered the definitive guide and I *think* I saw similar recommendations there, but unfortunately I don't have access to the book at the moment to be sure of that reference.
In short, I'd generally like to avoid tabindex because it commonly causes more harm than good. If we want to address just the "next" button coming before "back", we could do so by flipping the order in the HTML and then using CSS float to switch them around. But honestly, I find if tab order doesn't match page order, I get confused. The expectation is that tab order will follow page order and I think that would cause less problems than requiring a user to hit "tab" one more time to get to the next button.
Comment #2
Anonymous (not verified) commentedWell reasoned & insightful. Request withdrawn.
Comment #3
quicksketchThanks seezee, well at least we'll have a resource for the next time this gets brought up; I've considered this before but I don't think I had a write-up.
Comment #4
devd commentedHi seezee,
You can use webform tabindex module.
https://drupal.org/project/webform_tabindex