Entry: Highlight and Hyperlink entire table Saturday, November 24, 2012



I try several method on this. Some work on ie but unfortunately it doesn't work on firefox/chrome. After a few try and error, I managed to get the right coding on doing it. What I did is :-


Before:
I use <a href....> and add onclick function to open new window. This code work on ie but not in firefox or chrome

<a href=# onclick="window.open('new_link.php?act=search&id=<?=$id?>','blank','menubar=1,resizable=1,width=800,height=400,scrollbars=1,location=1,resizable=no')" >
<tr bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer">
<td>Try and error</td>
</tr>

 

I made some adjustment and found this one. Instead of adding onclick on <a href..>, I add this onclick on <tr> and call function to open new window.

After :

<tr bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer" onclick="get_link(<?=$id?:>);">
<td>Try and error</td>
</tr>


<script>
function get_link(id)
{
 window.open("new_link.php?act=search&id="+id,"aform","dependent=no,width=800,height=400,scrollbars=1,location=1,resizable=no,scrollbars=yes"); 
}

</script>


p/s : for <bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer" > this to add hand pointer and hightlight the entire table and it work on all browsers.

 

   0 comments

Leave a Comment:

Name


Homepage (optional)


Comments