473,379 Members | 1,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

control next object navigation

Is there an easy way to control navigation from one textbox to another?

I have 3 textboxes that happen to be in the same cell, but they are on the
page vertically. There are 4 cells next to each other this way.

When you tab, it goes to the textbox below it (unless it is the last box,
then it goes the top textbox in the next cell). I want it to go to the cell
on the right (not below it).

Is there a way to tell it to not use the default and tell it which box to go
to?

Thanks,

Tom.
Nov 19 '05 #1
8 1182
Set the TabIndex property of your textBox controls from 1 - 3 in the
order that you want the tabbing focus to go.

Sincerely,
James Fujino

Nov 19 '05 #2
<jf*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Set the TabIndex property of your textBox controls from 1 - 3 in the
order that you want the tabbing focus to go.
I tried that and it doesn't seem to work.

When I look at the ViewSource, there doesn't seem to be anything there on
the textboxes to indicate that they are supposed to tab to a different box
than normal.

Here is the code:

<td width="61" valign="bottom">Name:<br>
<asp:textbox id="ReferenceName1" TextMode="SingleLine" Columns="11"
TabIndex="0" runat="server" /><br>
<asp:textbox id="ReferenceName2" TextMode="SingleLine" Columns="11"
TabIndex="4" runat="server" /><br>
<asp:TextBox ID="ReferenceName3" TextMode="SingleLine" Columns="11"
TabIndex="8" runat="server" /><br>
<asp:textbox id="ReferenceName4" TextMode="SingleLine" Columns="11"
TabIndex="12" runat="server" /><br>
<asp:TextBox ID="ReferenceName5" TextMode="SingleLine" Columns="11"
TabIndex="16" runat="server" />
</td>
<td width="107" valign="bottom">Address:<br>
<asp:textbox id="ReferenceAddress1" TextMode="SingleLine"
Columns="20" TabIndex="1" runat="server" /><br>
<asp:textbox id="ReferenceAddress2" TextMode="SingleLine"
Columns="20" TabIndex="5" runat="server" /><br>
<asp:TextBox ID="ReferenceAddress3" TextMode="SingleLine"
Columns="20" TabIndex="9" runat="server" /><br>
<asp:textbox id="ReferenceAddress4" TextMode="SingleLine"
Columns="20" TabIndex="13" runat="server" /><br>
<asp:TextBox ID="ReferenceAddress5" TextMode="SingleLine"
Columns="20" TabIndex="17" runat="server" />
</td>
<td width="106" valign="bottom">Bus. Name:<br>
<asp:textbox id="ReferenceBusinessName1" TextMode="SingleLine"
Columns="20" TabIndex="2" runat="server" /><br>
<asp:textbox id="ReferenceBusinessName2" TextMode="SingleLine"
Columns="20" TabIndex="6" runat="server" /><br>
<asp:TextBox ID="ReferenceBusinessName3" TextMode="SingleLine"
Columns="20" TabIndex="10" runat="server" /><br>
<asp:textbox id="ReferenceBusinessName4" TextMode="SingleLine"
Columns="20" TabIndex="14" runat="server" /><br>
<asp:TextBox ID="ReferenceBusinessName5" TextMode="SingleLine"
Columns="20" TabIndex="18" runat="server" />
</td>
<td width="172" valign="bottom">Phone #:<br>
<asp:textbox id="ReferencePhone1" TextMode="SingleLine" Columns="11"
TabIndex="3" runat="server" />
<asp:Label ID="ReferenceUnique1" Visible="false" runat="server"
/><br>
<asp:textbox id="ReferencePhone2" TextMode="SingleLine" Columns="11"
TabIndex="7" runat="server" />
<asp:Label ID="ReferenceUnique2" Visible="false" runat="server"
/><br>
<asp:TextBox ID="ReferencePhone3" TextMode="SingleLine" Columns="11"
TabIndex="11" runat="server" />
<asp:Label ID="ReferenceUnique3" Visible="false" runat="server"
/><br>
<asp:textbox id="ReferencePhone4" TextMode="SingleLine" Columns="11"
TabIndex="15" runat="server" />
<asp:Label ID="ReferenceUnique4" Visible="false" runat="server"
/><br>
<asp:TextBox ID="ReferencePhone5" TextMode="SingleLine" Columns="11"
TabIndex="19" runat="server" />
<asp:Label ID="ReferenceUnique5" Visible="false" runat="server" />
</td>

Is there something else I am supposed to set for this to work?

Thanks,

Tom

Sincerely,
James Fujino

Nov 19 '05 #3
Notice the TabIndex attribute in the source you pasted. The number
value of this attribute is what the browser will use to figure out the
tab order.

If you leave the property TabIndex of the TextBox controls in the
Visual Studio designer blank, when the page renders ASP will just put
in the TabIndex for you in the order that the controls render on the
page.

You need to explicitly place a number in the TabIndex property of the
TextBox controls in the order that you want the controls to tab. Click
on the TextBox you want to set the tabIndex in Visual Studio and look
for the tabIndex Property in the properties window. There's not much
else to it. Hope this is clear enough.

Have a great day.

Sincerely,
James Fujino

Nov 19 '05 #4
<jf*****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Notice the TabIndex attribute in the source you pasted. The number
value of this attribute is what the browser will use to figure out the
tab order.

If you leave the property TabIndex of the TextBox controls in the
Visual Studio designer blank, when the page renders ASP will just put
in the TabIndex for you in the order that the controls render on the
page.

You need to explicitly place a number in the TabIndex property of the
TextBox controls in the order that you want the controls to tab. Click
on the TextBox you want to set the tabIndex in Visual Studio and look
for the tabIndex Property in the properties window. There's not much
else to it. Hope this is clear enough.
Isn't that what I did?

Also, I am not using Visual Studio and am just placing this in my .aspx
page. Could this be a problem? Is there something else that VS is doing
that I am not.

Also, I am not putting the number in all the boxes on my screen (there are
quite a few of them) - just these. Is that causing the problem?

Thanks,

Tom
Have a great day.

Sincerely,
James Fujino

Nov 19 '05 #5
An interesting thing I noticed about tabbing if I just created a small page
with 5 boxes on it is that if you have all 5 out of order where the first
box is 0, it will go from the 1st box to the URL Address line, to the Page,
then to the TabIndex 1.
************************************************** *************************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script runat="server">

</script>
<link href="../css/staffing.css" rel="stylesheet" type="text/css">

<link href="css/staffing.css" rel="stylesheet" type="text/css">
</head>
<body id="myBody" runat="server">
<form method="post" name="form1" class="BodyText" runat="server">
<asp:TextBox ID="TextBox1" tabindex="0" runat="server" />
<p>
<asp:TextBox ID="TextBox2" tabindex="2" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox3" tabindex="1" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox4" tabindex="4" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox5" tabindex="3" runat="server" /> </p>
</form>
</body>
</html>
************************************************** ****************************************

If I change the boxes to look like this (where the 1st box is 1 instead of
0), it will not go to the URL line and will follow the tabs.
************************************************** *******************************************
<asp:TextBox ID="TextBox1" tabindex="1" runat="server" />
<p>
<asp:TextBox ID="TextBox2" tabindex="2" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox3" tabindex="5 runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox4" tabindex="4" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox5" tabindex="3" runat="server" /> </p>

************************************************** *******************************************

If I take the tabindex out of the first 2 and start at the 1st box, it will
do the 1st box, go to the URL Line, the Page and then the 2nd box and follow
as expected.
************************************************** **********************
<asp:TextBox ID="TextBox1" runat="server" />
<p>
<asp:TextBox ID="TextBox2" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox3" tabindex="1" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox4" tabindex="3" runat="server" /> </p>
<p>
<asp:TextBox ID="TextBox5" tabindex="2" runat="server" /> </p>
************************************************** ************************

Setting the tabindexs on all the boxes and radio buttons would be a chore as
depending on input and database reads some of the objects won't be there.

Tom
Nov 19 '05 #6
The order that the browser interprets tabindexs is by first looking for
the lowest positive tabindex. So in the example above its 1. Then it
looks for the next number greater than it and so forth.

When it hits the greatest number it loops though the controls that
don't have a tabindex or have a tabindex of 0. So if you don't want to
place tab indexes for all your controls as long as the controls that
don't have tab indexes are in order then you should be ok.

Sincererly,
James Fujino

Nov 19 '05 #7
The low down on Tabindex can be found here.
http://www.w3.org/TR/REC-html40/inte...#adef-tabindex

Nov 19 '05 #8
BTW VS doesn't do anything special in regards to tabIndex, to answer
your side questions.
James

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: misscrf | last post by:
I have an entry form which has a tab control. If print screens are needed, please let me know and I will prepare them and post them. Anyway, this tab control has 3 pages. When I am on one of the...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
1
by: Luke | last post by:
Scenario - There's a file called TEST.TXT Pagebreak characters in the TEXT.TXT will be used to split the content of text file into multiple pages. A Navigation control (...
3
by: bcwatson | last post by:
My Access DB has a main data entry form. There are so many fields on the form that I've added a vertical scroll bar. When my cursor is in a text box near the bottom of the form and click on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.