Solved

JavaScript Highlight  or Select data a textbox

Posted on 2006-11-09
4
446 Views
Last Modified: 2012-08-13
Dear Experts.

I am using ASP.NET2.0, C#.
I want to make Highlight  or Select data in side a textbox through JavaScript.
0
Comment
Question by:RamyBouchra
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17905629
Define "Highlight":  change color?  change selection?

Bob
0
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 500 total points
ID: 17905799
See the following PAQ for JavaScript to achieve this:

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21843732.html
0
 

Author Comment

by:RamyBouchra
ID: 17906534
thank you for your reply
but i want it to be like if i pres TAB so it will be selected so i can write over it with out deleting the exsiting value.

thank you.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17906576
You must have missed this:

   textbox.setSelectionRange(0, textbox.value.length);

Call it with the onFocus event.

Bob
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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