Re: Making dropdowns in Web page behave like Access combo boxes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 04/20/04


Date: Tue, 20 Apr 2004 08:55:22 -0400

MDW wrote:
> Hey all. Say I've got a dropdown box that looks like this -
>
> <select size=1><option>Avery, Joe</option><option>Ickes,
> Jim</option><option>Walters, Sam</option><option>Wise,
> Mary</option></select>
>
> If I put my cursor on that box and hit the "W" key, it will jump me
> to "Walters, Sam". But say I'm actually interested in Mary Wise. If
> I then hit the "I" button, it jumps me to "Ickes, Jim."
>
> In Access (among others), if I'd hit "W", "I", it would have jumped
> me to Mary Wise. Is there any way (either through VBScript or
> JavaScript) to make that dropdown box accept more than one letter of
> input before it jumps to one of the options?
>
> Hope my question was clear. Thanks.

You cannot make the standard HTML dropdown behave like this. What you need
to do is use a textbox and a listbox. I have a demo of this at
http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp - look for
the dynamic listbox demo

HTH,
Bob Barrows

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Quantcast