470,625 Members | 2,085 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,625 developers. It's quick & easy.

How to select text in textboxs by clicking on it?

Hi there,
I have 10 textboxs on a page. When tab into a textbox, the entire text
($0.00) in a textbox is selected in blue. How do I have this effect by
single clicking on the textbox?

Nov 18 '05 #1
1 1002
Hi,

add this attribute to the TextBox:

onclick="this.select()"

For Example:
<asp:TextBox id="TextBox1" onclick="this.select()" runat="server">

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Lily" <lf***@mynycb.com> wrote in message
news:er**************@TK2MSFTNGP11.phx.gbl...
Hi there,
I have 10 textboxs on a page. When tab into a textbox, the entire text
($0.00) in a textbox is selected in blue. How do I have this effect by
single clicking on the textbox?

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Newbie | last post: by
4 posts views Thread by point | last post: by
4 posts views Thread by Dabbler | last post: by
1 post views Thread by ramya2611 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.