# Multi-character dropdown

**URL:** <https://www.ruby-forum.com/t/multi-character-dropdown/84451>\
**Category:** Rails\
**Created:** [February 4, 2007, 8:30pm UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451 "2007-02-04T20:30:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 4, 2007, 8:30pm UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/1 "2007-02-04T20:30:48Z")

</div>

The normal behavior for a drop-down (combo) box is to position itself to  
the next entry _STARTING_ with the character typed. In my experience,  
the more desired behavior would be to position it according to the total  
characters typed. In other words, If I type “AND”, I’d like the box to  
position itself to the first entry starting with “AND”.

Does anyone know a way to accomplish this?

Thanks in advance  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 5, 2007, 4:32am UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/2 "2007-02-05T04:32:44Z")

</div>

Works with firefox, not with IE (others?)  
If you want a real combo box, and not a simple html dropdown, try the  
auto complete helpers.  
The drop down will be generated by your server (via an xhr), you’ll be  
free to do whatever you want with the string entered. Yet I don’t know  
any simple way to get an ID back from the selected entry if the  
selected string is not itself a key in the database. I used to hack my  
way out by passing an “[id]” in the string and parsing it, but that is  
fugly 😕 May or may not be a good choice, then.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 5, 2007, 5:14am UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/3 "2007-02-05T05:14:08Z")

</div>

Benoit B. wrote:

> Works with firefox, not with IE (others?)

Multi-character selects work with FireFox? I’m missing something here.  
Is that a configuration parameter - or am I losing it? I don’t recall  
seeing this behavior. As a Linux type, Firefox is my main browser.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 5, 2007, 4:04pm UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/4 "2007-02-05T16:04:28Z")

</div>

Benoit B. wrote:

> Firefox win32 does it,

By default, or do you enable it somehow? Is it only in Firefox’s combos,  
or in combo boxes on forms on the web? If the former, it’s just the way  
they programmed it (I do that, too) - If the latter, I’m _REALLY_  
interested.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 5, 2007, 9:10am UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/5 "2007-02-05T09:10:58Z")

</div>

Firefox win32 does it, for sure. But a lot of people are not  
accustomed to it and won’t use it, since IE doesn’t support it. It’s  
very handy with country selection drop-down, esp. in China (I hate  
Chili! :O)

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 6, 2007, 6:40am UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/6 "2007-02-06T06:40:58Z")

</div>

It works on any combo-box, and it’s a default setting that have been  
there for ages…  
I don’t understand why you would be “_REALLY_ interested” in that  
since you don’t have any way to change this behavior on other browsers  
(As far as I know).

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [February 6, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/multi-character-dropdown/84451/7 "2007-02-06T22:28:14Z")

</div>

Benoit B. wrote:

> It works on any combo-box, and it’s a default setting that have been  
> there for ages…  
> I don’t understand why you would be “_REALLY_ interested” in that  
> since you don’t have any way to change this behavior on other browsers  
> (As far as I know).

What I’m doing is a specialized application. If I ask them to use  
Firefox for it, they will.
