Solved

Tooltip text for <OPTION>

Posted on 2004-03-25
7
1,782 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:Edeldragon
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, Havin_it. I'll give both of those a try.

ED
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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 …

772 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

8 Experts available now in Live!

Get 1:1 Help Now