Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to select text in textboxs by clicking on it?

Reply
Thread Tools

How to select text in textboxs by clicking on it?

 
 
Lily
Guest
Posts: n/a
 
      12-23-2003
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?



 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      12-23-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding labels and textboxs in formview templates according to role Ann ASP .Net Security 7 05-15-2007 05:13 AM
Hiding labels and textboxs in formview templates according to role =?Utf-8?B?QW5u?= ASP .Net 0 05-11-2007 11:09 PM
Accesing textboxs inside a table. Slim ASP .Net 6 07-31-2006 09:44 AM
Select text within a div tag by clicking on content of div tag? M Wells Javascript 0 10-06-2004 11:04 AM
select ID in drop down list and show name in text box without clicking submit button Matthew Louden ASP General 3 01-09-2004 09:52 PM



Advertisments