Link to home
Start Free TrialLog in
Avatar of praneetha
praneetha

asked on

<select

Hi

I Am trying the "title" for <select ....

but i can't get it to work...does anyone know the reason.

Thank You,
Praneetha Marthala
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

You are probably looking at the page using a defective browser like IE which does not support it.  You have to use a Mozill base browser to see it.

Cd&
Its wierd but each browser displays this in a different way.

Copy this into an html file and view it in IE, Mozilla and Firefox.

In IE, the tooltip appears on the second disabled select box and in Mozilla and Firefox its the opposite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<HTML><HEAD></HEAD><BODY>
<select title="test1">
<option title="option a">Option a</option>
<option title="option b">Option b</option>
</select>
<select title="test2" disabled="disabled"></select>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Maybe you should request to move this question to "Browser Issues" TA. You may get an answer there.

:) SD
Avatar of praneetha
praneetha

ASKER

how to get to work with IE. i mean is there any other way of getting the tool tip for dropdownlist.

Thank You.
yeah this is what i read in one of the websites...

hmm ok will post the question there too.
ASKER CERTIFIED SOLUTION
Avatar of ellandrd
ellandrd
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that sounds like a good workaround..thank you..will keep the question open for few more days and see if someone has better solution. i like your solution though.
Its an IE bug.
In IE the attribute title only appears if the <select> element is disabled.
In MozFirefox works the opposite. Only if it's not disabled.

rgds

alex
praneetha,
Try the following. Here visibility of a layer is set true or false based on mouse events. You may have to customize the values to your need.

<!-- HTML CODE START -->
<select id="selTest1" onmouseover="JavaScript:ToolTipShow(event.screenX, event.screenX, true)" onmouseout="JavaScript:ToolTipShow(event.screenX, event.screenX,false)">
                        <option>1</option>
                        <option>2</option>
                  </select>
                  <div id="div1" style="Z-INDEX: 9; LEFT: 100px; VISIBILITY: hidden; WIDTH: 50px; POSITION: absolute; TOP: 100px; HEIGHT: 15px; BACKGROUND-COLOR: lightyellow">Select a number</div>
                  <script language=javascript>
<!--
var bPositionSet = false;
function ToolTipShow(iLeft, iTop, bTrueFalse) {
      if (!bPositionSet) {
                               // you may asign these values static or dynamically, depends on the actual case.
           document.getElementById("div1").style.width=((document.getElementById("div1").innerText.length)*8)+"px";
           document.getElementById("div1").style.left=(iLeft+15)+"px";
           document.getElementById("div1").style.top=(iTop+40)+"px";
           document.getElementById("div1").style.zIndex=99;
           bPositionSet = true;
      }
      if (bTrueFalse) {       document.getElementById("div1").style.visibility = "visible"; }
      else { document.getElementById("div1").style.visibility = "hidden";}
}
//-->
</script>
<!-- HTML CODE END-->


Hope this helps.