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.
LVL 11
ManishLeadAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ManishLeadAuthor Commented:
after clicking on drop down arrow.
0
 
VoteyDiscipleCommented:
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
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
ManishLeadAuthor Commented:
so do you have javascript code?
0
 
ManishLeadAuthor Commented:
But width is increasing in IE , i dont want that.
It is working correct in firefox.

 
0
 
ethothsCommented:
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>
0
 
jessegivyDeveloperCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.