473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

highlighting or changing background of some text in input box

Hello,
I am trying to add an autocomplete functionality for tags, so I want
to just have the following capability:
If I type
ger

then the word my application matches that to is
german

So, I want 'ger' to look normal, and 'man' to be highlighted.

In an input box I can't use html tags, but I believe there is a
javascript function that will allow me to highlight just the part I
want highlighted.

How would I do this?

Thanx.

Jul 25 '07 #1
2 1432
On Jul 25, 9:55 am, James Black <planiturth...@gmail.comwrote:
Hello,
I am trying to add an autocomplete functionality for tags, so I want
to just have the following capability:
If I type
ger

then the word my application matches that to is
german

So, I want 'ger' to look normal, and 'man' to be highlighted.
You mean you want "man" to be selected.
>
In an input box I can't use html tags, but I believe there is a
javascript function that will allow me to highlight just the part I
want highlighted.
Look into createTextRange for IE and setSelectionRange for others.
The former creates a range object, which can then be manipulated to do
what you want. The latter can do it with one call. Make sure you
detect these methods before calling.

Jul 25 '07 #2
On Jul 25, 12:56 pm, David Mark <dmark.cins...@gmail.comwrote:
So, I want 'ger' to look normal, and 'man' to be highlighted.

You mean you want "man" to be selected.
I was hoping to be able to arbitrarily change the background for the
part I want selected, but that appears to not be possible.
Look into createTextRange for IE and setSelectionRange for others.
The former creates a range object, which can then be manipulated to do
what you want. The latter can do it with one call. Make sure you
detect these methods before calling.
Thank you very much.

Jul 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rossum | last post by:
I have a TabControl with a lot of tabs in it. Since it is sometimes difficult to tell which tab is currently active (all the pages have the same layout) I want to be able to highlight which tab is...
5
by: Adelson Anton | last post by:
Hi all, Ok, this is what I want to do: When you press, say Ctrl+K ( it doesn't matter which event), I want the , say, second word in the document to be highlighted. Anyone has any idea how...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
0
by: Brian Scott | last post by:
I am currently trying to control the syntax highlighting of a richtextbox control whilst the user types. At the moment I have implemented a thread which calls the richTextBox.Invoke on a method...
7
by: JohnSmith90 | last post by:
I want to highlight the entire cell data for all rows of a particular column in a data grid. I do not want to fill the back ground color of the cell. How to do that in a data grid? <span...
13
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php...
5
by: Xerxes | last post by:
Hi, I am using the following script (in an AS.NET application) to highlight text fields when they have the focus. Can I extend this to use other form elements such as textareas and dropdowns?...
2
by: russiandevil | last post by:
hi, Does anyone have an idea on how I'd go about highlighting (with a border, or something equally effective) a input button of type 'image' (i.e. <input type=image alt=Login src=http://<etc,...
8
by: Phil Latio | last post by:
I've been creating an application over the last few weeks and generally pleased with what I have produced but one area is irritating me, form validation. At the moment the forms are simply...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.