Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box (Drop Down Box)

Status
Not open for further replies.

Phudsen

Technical User
Mar 7, 2003
136
A2
Hi,

In MS Access you can filter the drop down box by typing character after character to reach the option.

Example:
--------
I have a drop down box that is getting Product Names from the database. If I type C it takes me to the first Product in C letter. Suppose I wanted to look for computers, If I type O after C in order to take me to CO, I get the first Product name in O.

In access you can do that with a combo box. If you have a long list of thing you can type the first 2 or three characters to reach what you want faster.

Is it possible in HTML? and how if Yes? Does it require JavaScript?

Thanks a lot
Paulin
 
the normal behaviour of a <select> allows stepping through the options using the first letter of the options list.
So "c" would select the first option beginning with "c" (case-insensitive) a second press will select the second option and so on.

While it should be possible to use javascript to modify this behaviour, It's rarely a good idea to change certain default behaviours from a usability POV.

javascript forum216

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
I wrote an article about this exact functionality here. I haven't had a chance to update the article, but you can actually leave out these lines:

Code:
    // determine the text string's length
    var intLength = strFilter.length;

They were part of the functionality that I removed.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Hi,

Thank you for your quick replies.

clFlaVA, this is a nice solution, but is there anyway to do it without the textbox?

Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top