Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tooltip text for <OPTION>

Posted on 2004-03-25
7
Medium Priority
?
1,795 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 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

660 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