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
Solved

Tooltip text for <OPTION>

Posted on 2004-03-25
7
1,787 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
  • 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

809 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