TabIndex

Discussion in 'ASP .Net' started by Wayne Wengert, Feb 11, 2005.

  1. I cannot get the tab settings on an aspx page to work as desired. First of
    all, I don't see a way to indicate whether a control is a tab stop. There is
    a tabindex property for labels (why?). When I set a specific order for the
    tabindex values that does not seem to be what happens on a page when the
    user presses the tab key?

    My books on asp.net don't even mention tabindex?

    How do you control the focus order on an asp.net page?

    Wayne
     
    Wayne Wengert, Feb 11, 2005
    #1
    1. Advertising

  2. Hi Wayne,

    Tabindex seems to be working okay in this sample. Just watch that you start
    at 1 and don't use -1.

    <form id="Form1" method="post" runat="server">
    <p>
    <asp:textbox id="TextBox1" tabIndex="1"
    runat="server"></asp:textbox></p>
    <p>
    <asp:textbox id="TextBox2" tabIndex="2"
    runat="server"></asp:textbox></p>
    <p>
    <asp:label id="Label1" tabIndex="4"
    runat="server">Label</asp:label></p>
    <p>
    <asp:button id="Button1" tabIndex="3" runat="server"
    Text="Button"></asp:button></p>
    </form>

    The label supports tabbing because when rendered, it comes out as a SPAN:

    <P><SPAN id=Label1 tabIndex=4>Label</SPAN></P>

    Does this help?

    Ken
    Microsoft MVP [ASP.NET]
    Toronto


    "Wayne Wengert" <> wrote in message
    news:...
    >I cannot get the tab settings on an aspx page to work as desired. First of
    > all, I don't see a way to indicate whether a control is a tab stop. There
    > is
    > a tabindex property for labels (why?). When I set a specific order for the
    > tabindex values that does not seem to be what happens on a page when the
    > user presses the tab key?
    >
    > My books on asp.net don't even mention tabindex?
    >
    > How do you control the focus order on an asp.net page?
    >
    > Wayne
    >
    >
     
    Ken Cox [Microsoft MVP], Feb 11, 2005
    #2
    1. Advertising

  3. Ken;

    Thanks for the response. I'll go back and try that again but since I don't
    ever want the users to tab to a label it would be nice to have a "TabStop =
    True/False" as we used to have.

    Wayne

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Hi Wayne,
    >
    > Tabindex seems to be working okay in this sample. Just watch that you

    start
    > at 1 and don't use -1.
    >
    > <form id="Form1" method="post" runat="server">
    > <p>
    > <asp:textbox id="TextBox1" tabIndex="1"
    > runat="server"></asp:textbox></p>
    > <p>
    > <asp:textbox id="TextBox2" tabIndex="2"
    > runat="server"></asp:textbox></p>
    > <p>
    > <asp:label id="Label1" tabIndex="4"
    > runat="server">Label</asp:label></p>
    > <p>
    > <asp:button id="Button1" tabIndex="3" runat="server"
    > Text="Button"></asp:button></p>
    > </form>
    >
    > The label supports tabbing because when rendered, it comes out as a SPAN:
    >
    > <P><SPAN id=Label1 tabIndex=4>Label</SPAN></P>
    >
    > Does this help?
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    > Toronto
    >
    >
    > "Wayne Wengert" <> wrote in message
    > news:...
    > >I cannot get the tab settings on an aspx page to work as desired. First

    of
    > > all, I don't see a way to indicate whether a control is a tab stop.

    There
    > > is
    > > a tabindex property for labels (why?). When I set a specific order for

    the
    > > tabindex values that does not seem to be what happens on a page when the
    > > user presses the tab key?
    > >
    > > My books on asp.net don't even mention tabindex?
    > >
    > > How do you control the focus order on an asp.net page?
    > >
    > > Wayne
    > >
    > >

    >
     
    Wayne Wengert, Feb 11, 2005
    #3
  4. Hey Wayne,

    If you don't want the label to participate in the tabbing, set its tabindex
    to -1.

    Ken

    "Wayne Wengert" <> wrote in message
    news:...
    > Ken;
    >
    > Thanks for the response. I'll go back and try that again but since I don't
    > ever want the users to tab to a label it would be nice to have a "TabStop
    > =
    > True/False" as we used to have.
    >
    > Wayne
    >
    > "Ken Cox [Microsoft MVP]" <> wrote in message
    > news:...
    >> Hi Wayne,
    >>
    >> Tabindex seems to be working okay in this sample. Just watch that you

    > start
    >> at 1 and don't use -1.
    >>
    >> <form id="Form1" method="post" runat="server">
    >> <p>
    >> <asp:textbox id="TextBox1" tabIndex="1"
    >> runat="server"></asp:textbox></p>
    >> <p>
    >> <asp:textbox id="TextBox2" tabIndex="2"
    >> runat="server"></asp:textbox></p>
    >> <p>
    >> <asp:label id="Label1" tabIndex="4"
    >> runat="server">Label</asp:label></p>
    >> <p>
    >> <asp:button id="Button1" tabIndex="3" runat="server"
    >> Text="Button"></asp:button></p>
    >> </form>
    >>
    >> The label supports tabbing because when rendered, it comes out as a SPAN:
    >>
    >> <P><SPAN id=Label1 tabIndex=4>Label</SPAN></P>
    >>
    >> Does this help?
    >>
    >> Ken
    >> Microsoft MVP [ASP.NET]
    >> Toronto
    >>
    >>
    >> "Wayne Wengert" <> wrote in message
    >> news:...
    >> >I cannot get the tab settings on an aspx page to work as desired. First

    > of
    >> > all, I don't see a way to indicate whether a control is a tab stop.

    > There
    >> > is
    >> > a tabindex property for labels (why?). When I set a specific order for

    > the
    >> > tabindex values that does not seem to be what happens on a page when
    >> > the
    >> > user presses the tab key?
    >> >
    >> > My books on asp.net don't even mention tabindex?
    >> >
    >> > How do you control the focus order on an asp.net page?
    >> >
    >> > Wayne
    >> >
    >> >

    >>

    >
    >
     
    Ken Cox [Microsoft MVP], Feb 11, 2005
    #4
  5. Thanks - that helps

    Wayne

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Hey Wayne,
    >
    > If you don't want the label to participate in the tabbing, set its

    tabindex
    > to -1.
    >
    > Ken
    >
    > "Wayne Wengert" <> wrote in message
    > news:...
    > > Ken;
    > >
    > > Thanks for the response. I'll go back and try that again but since I

    don't
    > > ever want the users to tab to a label it would be nice to have a

    "TabStop
    > > =
    > > True/False" as we used to have.
    > >
    > > Wayne
    > >
    > > "Ken Cox [Microsoft MVP]" <> wrote in message
    > > news:...
    > >> Hi Wayne,
    > >>
    > >> Tabindex seems to be working okay in this sample. Just watch that you

    > > start
    > >> at 1 and don't use -1.
    > >>
    > >> <form id="Form1" method="post" runat="server">
    > >> <p>
    > >> <asp:textbox id="TextBox1" tabIndex="1"
    > >> runat="server"></asp:textbox></p>
    > >> <p>
    > >> <asp:textbox id="TextBox2" tabIndex="2"
    > >> runat="server"></asp:textbox></p>
    > >> <p>
    > >> <asp:label id="Label1" tabIndex="4"
    > >> runat="server">Label</asp:label></p>
    > >> <p>
    > >> <asp:button id="Button1" tabIndex="3" runat="server"
    > >> Text="Button"></asp:button></p>
    > >> </form>
    > >>
    > >> The label supports tabbing because when rendered, it comes out as a

    SPAN:
    > >>
    > >> <P><SPAN id=Label1 tabIndex=4>Label</SPAN></P>
    > >>
    > >> Does this help?
    > >>
    > >> Ken
    > >> Microsoft MVP [ASP.NET]
    > >> Toronto
    > >>
    > >>
    > >> "Wayne Wengert" <> wrote in message
    > >> news:...
    > >> >I cannot get the tab settings on an aspx page to work as desired.

    First
    > > of
    > >> > all, I don't see a way to indicate whether a control is a tab stop.

    > > There
    > >> > is
    > >> > a tabindex property for labels (why?). When I set a specific order

    for
    > > the
    > >> > tabindex values that does not seem to be what happens on a page when
    > >> > the
    > >> > user presses the tab key?
    > >> >
    > >> > My books on asp.net don't even mention tabindex?
    > >> >
    > >> > How do you control the focus order on an asp.net page?
    > >> >
    > >> > Wayne
    > >> >
    > >> >
    > >>

    > >
    > >

    >
     
    Wayne Wengert, Feb 11, 2005
    #5
    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. Ravikanth[MVP]

    TabIndex of DataGrids

    Ravikanth[MVP], Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    346
    Deidre
    Jul 21, 2003
  2. kai

    Tabindex

    kai, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,014
  3. Natty Gur
    Replies:
    1
    Views:
    1,893
    Marshal Antony
    Mar 3, 2004
  4. Jarod_24

    how does TabIndex work?

    Jarod_24, Apr 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    755
    Jarod_24
    Apr 5, 2004
  5. Jarod_24

    TabIndex

    Jarod_24, Apr 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,740
Loading...

Share This Page