Solved

Tooltip text for <OPTION>

Posted on 2004-03-25
7
1,791 Views
Last Modified: 2012-08-13
Hi Experts

I tried this code in my browser and it didn't pop up with the tooltip text like it would if the object was an <INPUT type="text">.

<SELECT title="SelectTitle">
<OPTION title="OptionTitle1">1 </OPTION>
<OPTION title="OptionTitle2">2 </OPTION>
<OPTION title="OptionTitle3">3 </OPTION>
<OPTION title="OptionTitle4">4 </OPTION>
</SELECT>

Any suggestions? I am testing with IE6 and having tried using any other browsers to view it, so it might be IE.
0
Comment
Question by:Edeldragon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 10

Expert Comment

by:Havin_it
ID: 10676526
Edeldragon, can you be more specific?  I'm not familiar with the TITLE attribute; are you thinking of ALT or NAME perhaps?

I've never come across either a text field or a select-menu having a tooltip - do you have this effect working in other browsers, and if so which ones?
0
 
LVL 17

Accepted Solution

by:
dorward earned 50 total points
ID: 10676617
You're right, it is a limitation of IE. I believe some browsers do support it.

You options are:

Put a the full text inside the element, then use the value attribute to set the data you want...

<option value="1">OptionTitle1</option>

... or use something other then a <select> element - possibly a series of radio buttons.
0
 
LVL 1

Expert Comment

by:essage
ID: 10676688
Try this:

<SELECT NAME="SelectTitle">
<OPTION selected VALUE="OptionTitle1">1 </OPTION>
<OPTION VALUE="OptionTitle2">2 </OPTION>
<OPTION VALUE="OptionTitle3">3 </OPTION>
<OPTION VALUE="OptionTitle4">4 </OPTION>
</SELECT>
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

Author Comment

by:Edeldragon
ID: 10676898
Hi

Havin_it:

If you put <INPUT type="text" title="Tooltiptext"></INPUT> into a text file, save the file as test.html and then open the test.html file with IE (I use 6), and then hover your mouse over the input box, the text "Tooltiptext" will appear, just like tooltips in other applications. I've also used it with the <TD> tag, although I'm pretty sure that it will work with most other things, which is why I was surprised it didn't work with <OPTION>.

Dorward:
Thanks. I'm happy enough to accept it's a limitation of IE, just as long I wasn't missing something obvious :). I was hoping to show a description of the item I was listing as I hovered over its name, while the ID is the value, like you suggested. Not a biggy, but would have been some nice functionality. Sometime, I'll have to see if it works in other browsers.

Thanks for the answers.

ED
0
 
LVL 17

Expert Comment

by:dorward
ID: 10676938
Most elements support the title attribute, the exceptions tend to be those things which are implemented as OS controls (rather then browser controls) and don't usually display tooltips.
0
 
LVL 10

Expert Comment

by:Havin_it
ID: 10697891
I was thinking there are Javascripts to generate a tooltip based on the onMouseOver event, but that doesn't seem to work with individual options either - at least not the scripts I've tried.  Sorry.

I reckon the best you can hope for is a tooltip for the <select> itself, maybe containing all the option tips, but you're probably better just incorporating it into the text of each option.  If you're still interested though, try this:

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm
0
 

Author Comment

by:Edeldragon
ID: 10701581
Thanks, Havin_it. I'll give both of those a try.

ED
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

630 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