Link to home
Start Free TrialLog in
Avatar of APS NZ
APS NZFlag for New Zealand

asked on

onmouseover problem with HTML table

I am trying to use the onmouseover event with an html table cell.  It works fine in IE, but not in FireFox

For testing I am using the following code
<SCRIPT type="text/JavaScript">
  <!-- hide

function FillCalGrid(Nme)
  {
alert(Nme); 
}
  // stop hiding -->
</script>

Open in new window


And the HTML is
<A href="##" onmouseover="FillCalGrid('M1')"><TD vAlign=top width="13.13%" bgColor=#Trim(SetColor(GetShifts.Shift1))# ID=M1 onClick="addCalColor('M1')"><br><br>&nbsp;</TD></a>  

Open in new window


(The HTML above is just for one cell, but the same is repeated several times with different cell IDs
I am coding in ColdFusion hence the #s.)

In Firefox the addCalColor and SetColor routines fire correctly, but the onmouseover event never fires.

If I add "This is a test" just before <TD... , the text appears, and when I hover over the text the onmouseover event fires as it should, but it will not fire for just an empty table cell.

What am I doing wrong?
Avatar of William Fulks
William Fulks
Flag of United States of America image

Try putting &nbsp before <TD....> and see if that works.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America 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
Avatar of APS NZ

ASKER

Thanks for the replies William and Dave

@William - sorry, does not work

@Dave it won't work if it is within the <td>, even in IE.   I want to be able to hover anywhere within the cell.
Avatar of APS NZ

ASKER

Tested a bit more and @Dave you are correct - it now works - thanks very much!
You're welcome.