Ie6 dropdowns

M

Mark Smith

If I have a drop down box like this.

<select>
<option>hello</option>
<option>this</option>
<option>is</option>
<option>test</option>
<option>test</option>
</select>

And I highlight the box and type "this", the "this" option is
selected.

However in IE6, the selected option jumps to whatever the last letter
you type was. For example typing "thi" would select "is".

Is there a way to correct this behavior with javascript?

Thanks
 
E

Erwin Moller

Mark Smith schreef:
If I have a drop down box like this.

<select>
<option>hello</option>
<option>this</option>
<option>is</option>
<option>test</option>
<option>test</option>
</select>

And I highlight the box and type "this", the "this" option is
selected.

However in IE6, the selected option jumps to whatever the last letter
you type was. For example typing "thi" would select "is".

Is there a way to correct this behavior with javascript?

Thanks

Hi,

I didn't even know it worked like that in IE6.
If you want to correct it you must capture all keyboard events when the
select has focus, and act accordingly.

Another option would be to add a small textfield next to it, and use the
letters they type in there to limit the listed options when they match
(substring) the typed letters. I wrote a class for that some time ago.
(You can have it if you want.)

Personally I would say to my client (if you are working for a client)
that that behaviour is how MS intended it, and it shouldn't be fixed. ;-)

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top