473,372 Members | 878 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,372 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 1430
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.