Link to home
Start Free TrialLog in
Avatar of Manish
ManishFlag for India

asked on

Select tag drop down values.

Hi experts,
   I have select box which has fix width let say 100px.
If options contains value which is more than width, then
how to show full value to user without increasing size of select.

manish.
Avatar of Manish
Manish
Flag of India image

ASKER

after clicking on drop down arrow.
Avatar of VoteyDisciple
VoteyDisciple

It may be possible with Javascript to show the full text of the item on hovering.  Without increasing the size of the box you don't really have any pure HTML/CSS options
Avatar of Manish

ASKER

so do you have javascript code?
ASKER CERTIFIED SOLUTION
Avatar of bowen18
bowen18

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Manish

ASKER

But width is increasing in IE , i dont want that.
It is working correct in firefox.

 
You need to set the width using css...

        <asp:DropDownList ID="DropDownList1" runat="server" style="width:100px" />

or

        <select name="DropDownList1" id="DropDownList1" style="width:100px"></select>
There are no easy options here.  I've tried to get tooltips to work with option tags with no luck.  The other option would be to dynamically add multiple options and write lengthy code to link multiple options together.  The short answer and most accepted I believe, is to truncate the text, or simply increase the size of your dropdown and accomodate in your design.

...the standard if you decide to truncate is to use elipsis (...) at the end to indicate there's more text that's not being displayed.