Solved

JavaScript Highlight  or Select data a textbox

Posted on 2006-11-09
4
450 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

690 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