Using TABINDEX to remove from tab order?

Discussion in 'HTML' started by LRW, Apr 27, 2004.

  1. LRW

    LRW Guest

    I'm wanting to completely remove some textareas and A-links from the
    tab order of a form, so as you're tabbing down a list of checkboxes,
    the cursor doesn't skip over to another element in between.
    Is there a way to do that?
    I tried TABINDEX=0 but that did nothing.
    And I can't TABINDEX=1 through whatever on the checkboxes then go
    through the other elements, because the page is actually dynamically
    created with PHP. I need something I can put into the TEXTAREA and A
    HREF tags that will be the same for each one to prevent it from being
    in the tab order.

    Any sugggestions?
    Thanks!!
    Liam
    LRW, Apr 27, 2004
    #1
    1. Advertising

  2. (LRW) wrote:

    > I'm wanting to completely remove some textareas and A-links from the
    > tab order of a form, so as you're tabbing down a list of checkboxes,
    > the cursor doesn't skip over to another element in between.


    Why would you do that? You would then prevent anyone using keyboard-only
    access from getting to the textareas and links at all.

    > Is there a way to do that?


    To tell a white lie, no.

    > I tried TABINDEX=0 but that did nothing.


    Where did you put it, and why didn't you post a URL so that we could see
    what you actually did? The effect depends on the page and its TABINDEX
    values as a whole.

    > And I can't TABINDEX=1 through whatever on the checkboxes then go
    > through the other elements, because the page is actually dynamically
    > created with PHP.


    The specifications tell how TABINDEX is supposed to work. Why do you try
    using it in an apparently random way?

    > I need something I can put into the TEXTAREA and A
    > HREF tags that will be the same for each one to prevent it from being
    > in the tab order.


    No, you don't. Please explain the original problem that made you think
    so, and post the URL.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Apr 27, 2004
    #2
    1. Advertising

  3. LRW

    LRW Guest

    "Jukka K. Korpela" <> wrote in message news:<Xns94D8D60764C49jkorpelacstutfi@193.229.0.31>...
    > (LRW) wrote:
    >
    > > I'm wanting to completely remove some textareas and A-links from the
    > > tab order of a form, so as you're tabbing down a list of checkboxes,
    > > the cursor doesn't skip over to another element in between.

    >
    > Why would you do that? You would then prevent anyone using keyboard-only
    > access from getting to the textareas and links at all.
    >
    > > Is there a way to do that?

    >
    > To tell a white lie, no.
    >
    > > I tried TABINDEX=0 but that did nothing.

    >
    > Where did you put it, and why didn't you post a URL so that we could see
    > what you actually did? The effect depends on the page and its TABINDEX
    > values as a whole.


    Well, I can't post a URL because it's for an internal Web site at
    work, behind a firewall.
    It's a PHP page that generates a list of items from a database based
    on particular conditions, each item having a checkbox. The goal is the
    user is to select certain items they want to send on to place X.
    The other form elements being a textarea which most of the time is
    autimatically filled with text from the database, but sometimes not,
    and the user has the option to add something or change what's there.
    And an image of an item, hyperlinked to a pop-up window that shows a
    larger version of the image.
    So, the way the users prefer it to work, is to just be able to TAB
    through the list, SPACEBARing the items they want to select. In
    essence, to be able to just quickly
    TAB-TAB-SPACE-TAB-SPACE-TAB-SPACE-TAB-TAB-TAB-SPACE-etc through the
    list without having the cursor suddenly jump over to the textarea or
    the linked image.

    Make sense?
    I tried putting the TABINDEX=0 within the TEXTAREA and A HREF tags.

    I guess they'll just have to deal, and use their mice to scroll and
    select. =/
    Thanks,
    Liam
    LRW, Apr 28, 2004
    #3
  4. (LRW) wrote:

    > Well, I can't post a URL because it's for an internal Web site at
    > work, behind a firewall.


    As you wish. If you don't want to take the trouble of constructing a
    demonstration of the situation on the Web, with confidential information
    removed as needed, then you can't realistically expect to be helped. Our
    crystal balls are already overheated.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Apr 28, 2004
    #4
  5. LRW

    jstrid_01

    Joined:
    Jul 1, 2009
    Messages:
    1
    In case anyone comes across this post and wants a real answer to the question. Just set your tabindex to a negative number. tabindex="-1"
    This removes it from the tab order.
    jstrid_01, Jul 1, 2009
    #5
  6. LRW

    amykay

    Joined:
    Dec 12, 2009
    Messages:
    2
    Thanks for a straight answer, this helped me immensely!!
    amykay, Dec 12, 2009
    #6
  7. LRW

    amykay

    Joined:
    Dec 12, 2009
    Messages:
    2
    amykay, Dec 12, 2009
    #7
  8. LRW

    bearcatFulton

    Joined:
    Dec 14, 2010
    Messages:
    1
    Unanswered Tabindex Question

    The tabindex -1 thing was helpful, but I am having troubles like the thread starter.

    I am looking to make a list of checkboxes from items in a database like so.

    PHP:
    while($row mysql_fetch_array($cropsResult)){
                echo 
    "<tr><td class=\"toBuyList\"><input type=\"checkbox\"  name=\"hay[]\" value=\"" $row['cropType'] . "\" tabindex=\"5\"/> " $row['cropType'] . "</td></tr>";
            }
    I have not been able to get any items on that dynamic list into the tab index, even if the list has a size of one.
    bearcatFulton, Dec 14, 2010
    #8
  9. LRW

    rcof

    Joined:
    Dec 30, 2010
    Messages:
    2
    May or may not help, and for others with similiar form control requirements,
    best to use postive tabIndex values for the elements you DO want focus to, as section 508 compliance /people with screen readers still need to potentially get to those anchors/etc.

    by setting the tabIndex val to increasing positive numbers, its creating a priority queue...if you really only have two sets..ones with or without priority, you can give the priority ones the same val (such as all of them being tabIndex=1) then all those elemenets will get tabbed to first...then all the remaining ones after wards...(with tabIndex not set or set to "0")

    tabIndex of -1 wont ever let you get to them via keyboard although programatically you can still get there.(such as doc.getElementByID.focus()

    also note the tabIndex capitalization..it matters on some browsers -_- lowercase t and uppercase I.

    making a website §508 compliant over just sorta ignoring :)finger: ) your screen reading counterparts is most likly a better way to go ;)
    rcof, Dec 30, 2010
    #9
  10. LRW

    rcof

    Joined:
    Dec 30, 2010
    Messages:
    2
    :edit:

    additionally, A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA are the only elements to support tabIndex
    rcof, Dec 30, 2010
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    0
    Views:
    419
    Hermit Dave
    Jan 22, 2004
  2. Stefan Mueller
    Replies:
    4
    Views:
    5,938
    Jonathan N. Little
    Feb 25, 2006
  3. News Sympatico
    Replies:
    0
    Views:
    300
    News Sympatico
    May 21, 2005
  4. samira455
    Replies:
    0
    Views:
    1,032
    samira455
    Sep 12, 2006
  5. David Thielen

    Is TabIndex the right way to set the order of controls?

    David Thielen, Feb 27, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    185
    Steven Cheng[MSFT]
    Feb 28, 2007
Loading...

Share This Page