Solved

how to highlight text in textbox when in focus in

Posted on 2009-07-07
4
801 Views
Last Modified: 2012-05-07
I have a webform with textboxes if a user clicks on the textbox I want all the text in the textbox to be selected (highlighted)
0
Comment
Question by:mugsey
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
crisco96 earned 300 total points
ID: 24793105
<asp:textbox runat="server" text="Some Text" onfocus="this.select()" />
0
 
LVL 7

Assisted Solution

by:Valleriani
Valleriani earned 200 total points
ID: 24793115
If you are looking to highlight text in a textbox then you can do:

TextBox1.Attributes.Add("onFocus", "JavaScript:this.select();") for example!
0
 
LVL 7

Assisted Solution

by:Valleriani
Valleriani earned 200 total points
ID: 24793136
If it's using for example a inputbox, you could also just use:

<input type="text" name="test" onclick='this.select();'/>
0
 
LVL 7

Expert Comment

by:Valleriani
ID: 24793138
Oh my bad crisco96 already stated it above ;)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now