probably wont get a response on this, tab question

G

Guest

Hi, noticed high activity on this newsgroup as the last few posts I have made
have not received a response. Anyhow I noticed that with a .NET web
application when the webform opens if the user hits the tab key it goes to
the address bar at the top of the browser. I would like it to go to a
control and have set the tab index to 0 and 1 but still goes to the address
bar. Thanks.
 
D

David Young

Setting the tab index is the first step. You'll probably want to decide on
what control get focus when the form is displayed, then add some javascript
to the onLoad of the <body> tag.

ie<body onLoad="document.forms[0].controlName.focus();">

Then your tab order will be followed.

Dave
 
G

Guest

Hi thanks for the response. I added script as you described for the first
control to get focus. I have dropdown list boxes inbedded in a datagrid, I
think they call it template columns. I have the index set to 1,2,3 for these
but it does not seem to work. Perhaps I need to set the tab order for grid
=1, then embedded dropdown boxes as 2,3,4.
<script language="javascript" event="onload" for="window">
Form1.dropdown.focus();
</script>

David Young said:
Setting the tab index is the first step. You'll probably want to decide on
what control get focus when the form is displayed, then add some javascript
to the onLoad of the <body> tag.

ie<body onLoad="document.forms[0].controlName.focus();">

Then your tab order will be followed.

Dave
 
K

Kevin Spencer

This is going to be difficult, unless you can guarantee that IE will be used
by all users. IE supports tab indices, but most (If not all) other browsers
do not.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
G

Guest

thanks for the response. IE is used by all users as this is for an internal
web application. I was able to get it to work, just set the tabindex in
html.
<asp:TemplateColumn>
<ItemTemplate>
<asp:DropDownList id=dr_lst_poc tabIndex="5" runat="server"
Font-Size="X-Small" Font-Names="arial narrow" DataValueField="Poc_Id"
DataTextField="Poc_Name_VC" DataSource="<%# Ds_pocinfo1 %>"
AutoPostBack="True">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
I also have a Column with a selectable button, but noticed the tabindex is
not supported in the html section.
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update"
HeaderText=" Changes" CancelText="Cancel"
EditText="Accept">
<HeaderStyle Font-Size="Small" Font-Names="Arial
Narrow"></HeaderStyle><ItemStyle Font-Size="X-Small" Font-Names="Arial
Narrow"></ItemStyle>
This is going to be difficult, unless you can guarantee that IE will be used
by all users. IE supports tab indices, but most (If not all) other browsers
do not.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top