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?
LVL 3
jdthedjAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
Your formatting is wrong.  The <a href... should be inside the <td>.  In between <td>s is kind of a no mans land.  If it shows at all, it usually shows Before the table... because in-between <td>s is Not part of the table.
0
 
William FulksSystems Analyst & WebmasterCommented:
Try putting &nbsp before <TD....> and see if that works.
0
 
jdthedjAuthor Commented:
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.
0
 
jdthedjAuthor Commented:
Tested a bit more and @Dave you are correct - it now works - thanks very much!
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.