views:

108

answers:

2

I'm trying to create a uniform style for a small web form.

The problem is that the dropdown list seems to be pretty impossible to style as needed - the browser scroll options etc coming from the OS seemingly.

The solution I can see is to manipulate a combobox implementation so that I can use a text box, with the selections managed through JavaScript/CSS but I don't know where to start. It feels as though someone must have done something like this before but I've looked around Google and can only find poor examples of CSS on the droplist itself, or really heavily engineered ComboBoxes which I need to strip out to the nth degree to get working.

What I'm trying to create looks like this:

alt text

Has anyone done anything like this before, or could they point me at a decent resource for doing what I need. It is an ASP.NET implementation, but I'll happily utilise JQuery etc if needed?

Thanks for your help.

+2  A: 

Try the jQuery plugin Editable Select.

RegDwight
Thanks @RegDwight - this looks good. I somehow need to turn it into a "Uneditable Select" what would be the cleanest way to do that - somehow locking the form field?
Chris
@Chris: yes, and chances are that you won't even need JavaScript to achieve that. I would first try setting it to `readonly` or `disabled="disabled"` (the former is probably better, the latter will not only disable the field but also gray it out).
RegDwight
Thanks - will give that a whirl.
Chris
A: 

Listboxes are rendered by the OS and not by the browser. They will look different on a Mac vs Windows XP vs Vista etc.

As RegDwight suggests, you need to roll-you-own, using CSS/HTML/JavaScript and forget about using for anything more advanced.

Diodeus