probably wont get a response on this, tab question

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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
 
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.
 
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.
 
Back
Top