Solved

How to get tooltip for a HTML DropDown options (Select box) ?

Posted on 2004-08-25
3
853 Views
Last Modified: 2008-01-09
I have a select box of limited width. The names of the options are longer than the available select box width. How can I get the full option names appearing as tooltips, when going over the options...
0
Comment
Question by:hyder
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 11892361
Mozilla based browsers only:

<option title="your tooltip"> option1 </option>

For IE there is nothing.  If you have to have the functionality for IE, you have to build a custom DHTML control and script the behaviours of a select.

Cd&
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 11896627
Maybe option group's would help you here...
http://www.w3schools.com/tags/tag_optgroup.asp
0
 

Expert Comment

by:Heama
ID: 12255969
<HTML>
<HEAD>
<TITLE>Radhika's ........ :)</TITLE>
<style>
a.info{position: relative;z-index:24;background-color:#ccc; color:#000; text-decoration:none}
a.info:hover{z-index:25}
a.info span{display: none}
a.info:hover span{display:block;
    position:absolute; top:2em;left:2em; width:10em;
    border:1px solid #000; background-color:#FFFFCC; color:#000;text-align: center}
   
</style>
<SCRIPT>
function mOver()
{
      document.all.sp.innerHTML = document.a.s.options[document.a.s.selectedIndex].text;
}
function mOut()
{
      document.all.sp.innerHTML = "";
}
</SCRIPT>
</HEAD>
<BODY>
<form name=a>
<a class="info" href="javascript:void(0)">
<select name=s onmouseover="mOver()" onmouseout="mOut()">
      <option value=1>one</option>
      <option value=2>two</option>
      <option value=3>three</option>
</select><span id=sp></span></a>
</form>

</BODY>
</HTML>
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now