Topic: select drop down width problem

hi,

    I am using a select box with optgroup and my option are very lengthy. when I click on the select box lengthy option being cutt-off and the same time I have one more select box and the width of select box option list is increased automatically.
                                                           please tell me how can control the width of select dropdown list.

thanks in advance.

Re: select drop down width problem

You should just be able to do it in your stylesheet with:

#select_id {
  width: 300px;
}

Where select_id is the id of your select box (if you're using the select method, the id will be the object name, an underscore then the method name, e.g. "user_address")

Alex

Re: select drop down width problem

Alex,
     thanks for your replay but I don't want to increase the width of select box. I want to increase the width of drop down list of the select box.

Re: select drop down width problem

I was able to accomplish this for select lists just but using the following:

select {
  width: 125 px;
}

You can restrict this to certain divs so that it isn't a global setting if you want. For instance I actually had this code:

#left_column select {
  width: 125 px;
}

This also works nice for text boxes as well. Just substitute "select" for "input". Hope that helps.

Last edited by etandrib (2007-07-12 15:55:57)

Re: select drop down width problem

Mahendra - wondering if you ever got the answer to your problem.....I, too, am wondering if there is a way to keep my dropdown a controlled width but then have my dropdown list the necessary width to show all items in it.....any way to do this?

Last edited by nikikelly74 (2007-08-31 09:57:45)