Solved

Tooltip text for <OPTION>

Posted on 2004-03-25
7
1,790 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating number not work with decimal 4 46
title attribute 5 33
Display Flex does not Wrap Items 2 46
html link offset in page with umlaut character in address 5 32
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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