PDA

View Full Version : Abt Combo Boxes


anandraj
06-21-2003, 10:50 AM
Hi All,
I have a combo Box in my Page but the text is more than the width of the combobox coz of that users are not able to see the content. Is it possible to give the tooltip for the items in the Combo Boxes like title or some other method.

Thanks
Anandraj.A.

scroots
06-21-2003, 01:23 PM
do you have the code for the combobox as i have a plan that may work. I will need to see your code to decide on the best way.

scroots

Adam20002
06-21-2003, 04:53 PM
What about applying CSS to the combo box to dictate the width of the control ?

Adam

Graeme Hackston
06-21-2003, 05:51 PM
I thought selects grow to the size of the largest option. How long are your options? Also, maybe optgroup will help?

<select>
<optgroup label="group 1">
<option>option 1</option>
<option>option 2</option>
</optgroup>
<optgroup label="group 2">
<option>option 1</option>
<option>option 2</option>
</optgroup>
<optgroup label="group 3">
<option>option 1</option>
<option>option 2</option>
</optgroup>
</select>

scroots
06-21-2003, 07:31 PM
Graeme what browsers does the option group thing work in and what difference is it ment to be?

scroots

anandraj
06-23-2003, 07:54 AM
Hi Graeme,
Great Its working fine. Can i make one of the option with bold and selectable by the user. Here I am not able to select the bold one.
Below is my code where i am not able to see the lengthy text.
Is there any way to do it?

<select style=width:100>
<option>option 1</option>
<option>I am the lenghiest text in this page to test the width problme in the Combo Boxes</option>
</select>
Thanks
Anandraj.A.

Adam20002
06-23-2003, 12:44 PM
Remove the width setting from the select box. Then as Graeme says the box should size to fit the largest option.

If you need to set the width for a particular reason which is not seen here then you will have to set the value to something greater than 100.

Adam

Graeme Hackston
06-23-2003, 07:45 PM
Hi guys, sorry for the late reply.

scroots, I'm not sure but I believe most modern browsers. It sometimes helps to reduce the length of options. By using a heading for each group some of the option text may be able to be removed.

anandraj, if I'm understanding you, optgroups aren't selectable. Yes you can style optgroups or options but there are some limitations depending on the browser. As Adam20002 said, removing the width will do what you need.

anandraj
06-24-2003, 04:55 AM
Hi Graeme,
Actually I want to fix the width of the combo Box so that it will fit in the page exactly where i wanted. Any solution for this will be great.
Any how Thanks for the reply.

Thanks
Anandraj.A.

Graeme Hackston
06-24-2003, 07:24 PM
I'm pretty sure it's impossible. There's no mechanism for horizontal scrolling in a drop down.

I have read of people creating DHTML drop downs to get around this issue but I've never seen an example.

scroots
06-25-2003, 11:16 PM
you could show it in a div that appears.

I will churn up some code.

scroots