Hello all,

I am using IE.
I have dropdown list with <select><option></option></select> on which i cannot provide custom tooltip on hover, because <option> will not support onmouseover event.

so i am now supposed to create one custom dropdownlist not using <select><option></option></select>.
may be using combination of <table> and <textbox> on which i can write functions to show tooltip.

please let me know how can i do this?

KPooja, I'm not sure how much you hope to get out of your tooltips, but have you considered using the 'title' attribute in your option tags. This works on both IE and Firefox, although I didn't have as much luck with Chrome, Safari, or Opera.

KPooja, I'm not sure how much you hope to get out of your tooltips, but have you considered using the 'title' attribute in your option tags. This works on both IE and Firefox, although I didn't have as much luck with Chrome, Safari, or Opera.

Thank you for your reply.
here, 'title' attribute i cannot use because as i know we cannot increase the time to show tooltip using title attribute. 'tittle' attribute when i use it will stay for short period of time and will dissappear after some time.so my problem is here, i am not able to increase the timestamp thats why i am switching custom dropdown list.
If you have any idea how to increase the timestamp in 'title' attribute then i can use that.

Thank you.

I dont believe a dropdown list can add an onmouseover attribute.

What you could do is create a div, then for each item create a span (this would be your 'options').
For each span give it an onmouseover attribute which would call a script to display a div.

Basically youre creating your own dropdownlist.... AND the added benefit is.... you can give it your own style instead of being stuck with tge generic dropdown lists :)

I dont believe a dropdown list can add an onmouseover attribute.

What you could do is create a div, then for each item create a span (this would be your 'options').
For each span give it an onmouseover attribute which would call a script to display a div.

Basically youre creating your own dropdownlist.... AND the added benefit is.... you can give it your own style instead of being stuck with tge generic dropdown lists :)

Hi,

I have tried with the solution you provided with div tag and span tag. My code looks like this for span tag:
<div id=mydiv></div>
<select>
<option value="<%=div%>"><span onmouseover="toolTip(mydiv)"><%=ls_Name%></span></option>
</select>
But it is not working.

let me know what modifications i need to do to consider onmouseover event for this dropdown.
Thank you.

No you cant do that...
Forget about using a select entirely.
What Im saying is somthing like this.......

<div id="divMyCustomSelect" style="blah blah" onClick="showFunction();">
<span id="span1" style="blah blah" onMouseover="someFuction();"
<span id="span2" style="blah blah" onMouseover="someFuction();" onClick="someOtherFunction();">onClick="someOtherFunction();">
</div>

In this scenario when you click on the div (the fake dropdown), you would create a javascript that would then show all the spans. As you mouse over the spans the mouseover event would trigger. You can then add an onlick event if you want to select that value (span.innerHTML). Making sense?

No you cant do that...
Forget about using a select entirely.
What Im saying is somthing like this.......

<div id="divMyCustomSelect" style="blah blah" onClick="showFunction();">
<span id="span1" style="blah blah" onMouseover="someFuction();"
<span id="span2" style="blah blah" onMouseover="someFuction();" onClick="someOtherFunction();">onClick="someOtherFunction();">
</div>

In this scenario when you click on the div (the fake dropdown), you would create a javascript that would then show all the spans. As you mouse over the spans the mouseover event would trigger. You can then add an onlick event if you want to select that value (span.innerHTML). Making sense?

Yes. thank you for the solution. I am able to do this way.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.