I have a page that is currently generating dynamically created textboxes in a table format. The users are requesting that the tab order be changed from horizontal-vertical to vertical-horizontal. I know that you can use the tabindex attribute to control the tab ordering, but I can’t for the life of me figure out the right way to get the sequential number properly for the textboxes. I guess this is more of a math question than anything else!
FYI, the textboxes are made while looping two different collections. First collection looped to make the rows, for each row, second collection (which is a property of the first collection objects) is looped to create the columns.
Any help would be greatly appreciated. Thanks!
You will need three variables to get this to work:
You can then achieve the vertical tab order by setting the tabindex to:
For a five-row, three-column table the above calculation would render the tab order as:
Updated: Wil, thanks for pointing that out. I’ve updated the example. I also checked the W3C spec (which I probably should have done first) which clarifies the behavior: