Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have a drop down list with list of items
when ever i select any item i need to get TOOL TIP on that listed items,

below is the code which i have written this is working for internet explorer 7.0
not working for IE 6.0,
please can u send the code for internet exp 6.0.

for (int i = 0; i < ddl Country.Items.Count; i++)
ddl Country.Items.Attributes.Add("title", ddl Country.Items.Text);
Posted
Updated 30-Jun-11 3:09am
v3

There is a lot of confusion about tooltips on DropDownLists. Here's the facts.

IE for Windows does not support the Tooltip property or even the title attribute on the <select> control. This is because they create a separate window for the <select> tag that is above the rest of the info on the browser window. (Think of it as another layer.) The tooltip engine is actually on the main window layer, so the tooltip would appear behind the <select> element if it was to appear. This layered behavior also breaks popups that position over <select> tags because they are always on the main window layer!

The title= attribute is fully supported in the W3C specification, which is used by the DOM-based browsers like Mozilla, FireFox, Netscape, and Safari. So by assigning myDropDownList.Attributes.Add("title", "text"), you will get a tooltip on those browsers!

Finally, the suggestion to enclose the DropDownList in the
with a title= attribute will only work so long as the user does not point to the <select> element itself because of the layering problem.

We can only hope Microsoft puts <select> tags into the same layer in a future version of IE...

Credit goes to PLBlum
 
Share this answer
 
v2
Comments
Rubaba 6-Jul-11 1:05am    
good answer.+5
Monjurul Habib 6-Jul-11 13:14pm    
thank you.
This is server-side code and has nothing to do with any browser. The problem, if any, is in the html that is generated.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900