Is there control of Tab Stops on webform controls?

J

James Radke

Hello,

I have several read only textbox fields on a web page, and was curious if
there is any way to set them so when the user tabs through the web page,
they are skipped?

Thanks!

Jim
 
M

MSFT

HI James,

To make it can skip the Tab key, you may use a HTML Text field or disable
the ASP.NET Web TextBox control.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
J

James Radke

But if I disable the textbox control, won't the text be displayed as grayed
out, even if it is readonly?

Jim
 
J

James Radke

Luke,

But then we wouldn't have the data in state in our web page-code-behind,
correct?

Jim
 
M

MSFT

Hi Jim

There is a scipting solution for this problem. For example, you have two
TextBox: TextBox1 and TextBox2 on the web form. TextBox1 is readonly. You
may add following code in form_load:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

TextBox1.Attributes.Add("onfocus", "TextBox2.focus();")
End Sub

As we know, the focus will still be set to TextBox1 even it is readonly.
Above code will force cursor go to TextBox once TextBox1 get focus.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top