Hello everybody,
Would you please give me some tips aboput tooltip? I would like to use it with <option> of <select> element. The text will come from oracle database. And I like to happen this when user will move cursor over the options of <select> element. I am working with PHP, Apache and Oracle.
Thank you in advance.
ZIA
how to use tooltip in select element
Moderator: General Moderators
You just need HTML:
the key is "title" - works like the "alt" for images.
Code: Select all
<a href="whatever.html" title="This is a link to whatever.html">whatever</a>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You can use the title attribute in the option tags:
but whether or not a browser will show that info to the user as a 'tooltip' will depend on the browser.
Mac
Code: Select all
<option value="something" title="something else">text</option>Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Just done a couple of tests and as far as I can see:
IE 5 - no (doesn't show tooltip)
Mozilla - yes (shows tooltip)
Netscape 6 - yes
Opera 6 - no
Netscape 4 - no
Not an exhaustive test but support seems fairly patchy. Maybe you want to think a little more about what you are trying to accomplish?
Mac
IE 5 - no (doesn't show tooltip)
Mozilla - yes (shows tooltip)
Netscape 6 - yes
Opera 6 - no
Netscape 4 - no
Not an exhaustive test but support seems fairly patchy. Maybe you want to think a little more about what you are trying to accomplish?
Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Having done a search on Google for tooltip select option it looks like an IE solution involves a lot of JavaScript and CSS hacking. Maybe there's another way you could get the information you need to to your users?
Mac
Mac
<select> under IE 4+ supports the "onmouseover"-event. So basically, you can create an associative array with tooltips for each individual <select>-option. Get the mouse-co-ordinates when the mouseover is triggered, write the tooltip from your associative array into the layer, move the layer to the x,y-co-ordinates, then make it visible.
That way you would have something wich would work in IE - but I have no clue whether <select> supports "onmouseover" in other browsers.
That way you would have something wich would work in IE - but I have no clue whether <select> supports "onmouseover" in other browsers.