PDA

View Full Version : listbox question



chelvis
Feb 4th, 2003, 06:09 PM
I have a list box like follows:

<select name="combine" size="5" multiple>
<option value="1">Plastics</option>
<option value="2">Paper making</option>
<option value="3">Latexes!</option>
</select>

Here the list box takes the width of the longest string. Can I specify the width of a list box in the code some thing like this?

<select name="combine" width="20" size="5" multiple>

I tried didnt work. Is there any way? Because in my website, I have to initially have a blank list box. Then when a user check a check box, the text next to it will be placed in this list box. So initially when there is nothing, the list box would look so narrow and the user wouldnt even know what is it.

requestcode
Feb 4th, 2003, 07:58 PM
I believe you can do it with a style tag:
<select name="combine" style="width:50;" multiple>

That would be 50 pixels. If you want to have the same style for all selects then you could try this:
select {color:#3300CC;font-weight:bold;width:600;background-color:#AAAAAA;}

Forgot to mention that NS4 will ignore the style. I don't believe there is a way for NS4.