Solved

JavaScript Highlight  or Select data a textbox

Posted on 2006-11-09
4
449 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

739 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