Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent: complete highlight position in the table

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
Hi

I'm trying to highlight a position in a table. KevenFSI wrote a nice post but I am having trouble implementing it. I have an image map that when clicked should hyperlink to a table and highlight the cell. I've tried this code:

<Map Name=&quot;ESDailyReport&quot;>
<Area Shape=&quot;Rect&quot; HREF=&quot;#AirDryerA&quot; Coords=&quot;159,296,180,307&quot;
OnClick=&quot;document.getElementById('AirDryerA').style.backgroundColor='Yellow';&quot;>
</Map>
<IMG USEMAP=&quot;#ESDailyReport&quot; SRC=&quot;../Images/AirWateFuels.jpg&quot; Border=&quot;0&quot;>

I get the error message &quot;that this object is not supported&quot;. Does anyone know what is wrong? Should I have &quot;JavaScript:&quot; somewhere?

Thanks,
Rewdee
 
try this...

OnClick=&quot;document.getElementById('AirDryerA').style.background-color='Yellow';
 
Thanks for the post--I no longer get the error message But neither do I get the cell colour to change. Any ideas?

Thanks,
Rewdee
 
Did you properly identify your cell?...

Also, I'm not sure, but that might not be javascript...it looks like VBscript...but I haven't messed w/ any scripting in a while so I could be wrong. Regards,
Anth:cool:ny
----------------------------------------
&quot;You say [red]insanity[/red] like it's a BAD THING!&quot;
 
I think so

<td ID=&quot;AirdryerA&quot; WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
ALIGN=&quot;LEFT&quot; ><a name=&quot;AirDryerA&quot;>AirDryerA</font></td>
 
I tried your code exactly as it appears here and it worked fine. What browser/OS are you using? Kevin
slanek@ssd.fsi.com
 
I'm using IE 4.0, also, my HTML resides on a file server but I don't think that should matter as much as the browser. When you click on the image map, does your hyperlink to a table cell and highlighting work in your example. Are you using background-color='Yellow'?

Thanks,
Rewdee
 
Yeah, I'm using the exact code you wrote in your post. I'm not sure this will work in 4.0 though. I know for a fact it works in IE5+. That may be where the problem is. Kevin
slanek@ssd.fsi.com
 
Can someone try this code and see if it works. Kevin said he tried it and it worked in IE5+ but when I took it home on IE6.0 it did not and it does not work in IE4.0. If you could post whether it works or not, I would sure appreciate it:

<html>
<head>
<title>ESDaily</title>
<meta HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html;charset=windows-1252&quot;>
</head>
<body>
<Map Name=&quot;ESDailyReport&quot;>
<Area Shape=&quot;Rect&quot; Coords=&quot;159,296,180,307&quot;
OnClick=&quot;document.getElementById('AirDryerA').style.background-Color='yellow';&quot;>
</Map>
<IMG USEMAP=&quot;#ESDailyReport&quot; SRC=&quot;../Images/AirWateFuels.jpg&quot; Border=&quot;0&quot;>
<table BORDER=&quot;1&quot; CELLSPACING=&quot;0&quot; BORDERCOLOR=&quot;#000000&quot; CELLPADDING=&quot;2&quot; WIDTH=&quot;100%&quot;>
<tr>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#c0c0c0&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><b><p
ALIGN=&quot;CENTER&quot;>Control Name</b></font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#c0c0c0&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><b><p
ALIGN=&quot;CENTER&quot;>Source Name</b></font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#c0c0c0&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><b><p
ALIGN=&quot;CENTER&quot;>Tag_Freq_Id</b></font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#c0c0c0&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><b><p
ALIGN=&quot;CENTER&quot;>Tag</b></font></td>
<td WIDTH=&quot;28%&quot; BGCOLOR=&quot;#c0c0c0&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><b><p
ALIGN=&quot;CENTER&quot;>AlterCode</b></font></td>
</tr>
<tr>
<td ID=&quot;AirDryerA&quot; WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
ALIGN=&quot;LEFT&quot; ><a name=&quot;AirDryerA&quot;>AirDryerA</font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
ALIGN=&quot;LEFT&quot;>AirDryerA</font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
ALIGN=&quot;LEFT&quot;>64</font></td>
<td WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
ALIGN=&quot;LEFT&quot;>31AI13A</font></td>
<td WIDTH=&quot;28%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;></td>
</tr>
</table>
</body>
</html>

Thanks,
Rewdee
 
This is the exact code I tried. It works for me. You might try stripping everything else out of your code and getting it down to the map and the cell you're trying to highlight. Once you get that working, then add your other cells in there.
Code:
<Map Name=&quot;ESDailyReport&quot;>
  <Area Shape=&quot;Rect&quot; HREF=&quot;#AirDryerA&quot; Coords=&quot;159,296,180,307&quot; OnClick=&quot;document.getElementById('AirDryerA').style.backgroundColor='Yellow';&quot;>  
</Map>
<IMG USEMAP=&quot;#ESDailyReport&quot; SRC=&quot;testPic.jpg&quot; Border=&quot;0&quot;>

<TABLE BORDER=&quot;1&quot;>
  <TR>
    <td ID=&quot;AirdryerA&quot; WIDTH=&quot;18%&quot; BGCOLOR=&quot;#ffffff&quot; HEIGHT=&quot;18&quot;><font FACE=&quot;Arial&quot; SIZE=&quot;2&quot; COLOR=&quot;#000000&quot;><p
    ALIGN=&quot;LEFT&quot; ><a name=&quot;AirDryerA&quot;>AirDryerA</font></td>
  </TR>
</TABLE>
This is exactly how it appears on the page I'm using to test your code. Kevin
slanek@ssd.fsi.com
 
Also, for testing purposes, lose the <P> tags and the <FONT> tags. The less code on the page, the less code to troubleshoot. Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top