multi-part branching accordion style form and tab index

1 replies
  • WEB DESIGN
  • |
I'm in the middle of building a long form which branches and opens 1 hidden section if radio box A is selected and another if radio box 2 or 3 is selected. What I'm wondering is how I should set up the tab-index(es) so that a person can tab through the respective visible parts of the form without tabbing into a hidden part so they open up what should be closed or lose the focus from the tab key?
#accordion #branching #form #index #multipart #style #tab
  • Profile picture of the author SteveJohnson
    You set your tab indices up in the sequence that the form fields appear in the DOM, even the hidden ones, then use javascript to set the tabindex attribute of the non-visible form fields to -1 after storing their original value. Then when a user opens up a hidden section, restore the original tab indices.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[7325815].message }}

Trending Topics