*
The moose likes HTML, CSS and JavaScript and the fly likes Advanced selection in a drop-down list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Advanced selection in a drop-down list " Watch "Advanced selection in a drop-down list " New topic
Author

Advanced selection in a drop-down list

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
is there a way in HTML or DHTML or Javascript or ActionScript to implement
this:
in a HTML page, I have a drop-down sorted list:
<SELECT NAME="Code" size="1" >
<OPTION VALUE="All">All
<OPTION VALUE="AACC" SELECTED>AACC
<OPTION VALUE="ABCDD">ABCDD
<OPTION VALUE="ABK">ABK
<OPTION VALUE="BCCC">BCCC
<OPTION VALUE="CABC">CABC
<OPTION VALUE="CBBB">CBBB
<OPTION VALUE="DACA">DACA
</SELECT>
If I press the letter A, the drop-down list points directly to the first
value in the list that
starts with an 'A' ==> AACC
If I press the letter C, the drop-down list points directly to the first
value in the list that
starts with an 'C' ==> CABC
What i want is the possibility to type a second letter:
If I press the letter A, the drop-down list points directly to the first
value in the list
of values starting with an 'A' ==> AACC and if i press 'B', this should
point to 'ABCDD',
and again if i press a third letter 'K', this should point to 'ABK'.

How do i do this ? (in HTML or DHTML or Javascript or ActionScript or even
Java/JSP/Servlet ?
thanks


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Yes it can be done.
Look at this disscussion on another forum
http://www.codingforums.com/showthread.php?s=d6696056278878a45e22cff902335637&threadid=9865
The discussion is long (4+ pages of threads so look through it to find the best script)
Eric
 
Don't get me started about those stupid light bulbs.
 
subject: Advanced selection in a drop-down list