tags:

views:

42

answers:

2

i have a selectbox with Country code values, they have a "short" label (2 letters) and a "long" label (full name).

when not selected i want the "short" label to appear, but when clicked and the full selection appears to chose from the "long" labels should appear in the dropdown.

is this even possible with html? or do i need to render a textfield and draw the selction over it using js/css? is there maybe an advanced component available in any framework?

+2  A: 

It's not possible with pure HTML. This may call for a Javascript based SELECT replacement.

Check out these resources:

(Wanted to post examples for each JQuery, Prototype and Mootools based plugins to avoid Frameworkism, but can't find any quickly right now)

Pekka
+2  A: 

It might be simpler to wire up a textbox with a js drop down that has the short label and populates with the full name. There are a ton of them out there that already do most of this, it would just be a couple of tweaks for the full effect.

Joel Etherton
Good and simple idea.
Pekka