tags:

views:

41

answers:

3

Hi everyone,

How can I show 10 option out of 100 in the drop down list and the rest to be available using scrollbar?

thanks a lot.

+1  A: 
<select multiple="multiple" size="10">
roryf
Actually, you don't really need the "multiple" attribute. It works fine by just setting the size attribute. But I gave you a bump anyway.
Robusto
@Robusto interesting, but I think from a readability point of view I'd be inclined to include it to reduce confusion.
roryf
A: 

I think <select multiple="multiple" size="10"> produces a list, not a drop down...

blob8108
A: 

You could try this little trick...

<select max="2" onmouseover="this.size = 10" onmouseout="this.size = 1">

it effectively makes your select drop down into a list on mouse over and puts it back on mouse out.

it's cheating and can mess up your html positioning, but it works.

Edit: I'm pretty sure you can't change the size of the menu displayed when you click a select, this is determined by the browser and not controllable by the page.

Shaded