Forum Moderators: open

Message Too Old, No Replies

color td cells in a column

Want to color specific cells on a click event

         

beetle0674

4:23 am on Oct 31, 2004 (gmt 0)



Hi, I hope somebody can help me.
I have a table with 4 cells with a radio button in each cell for each column, which is in the first row.

When a radio button has been clicked, I want to be able to color the whole column that has been selected.

This is only some of the code, which will hopefully help you understand about the radio buttons.

<tr>
<td colspan="2" align="center">
Please select the cover you require
</td>
<td align="center">
<INPUT type="radio" ID="plan1" NAME="Plan" VALUE="Pick & Mix" onclick="onclick2(this, 1, 2, 1);" >
</td>
<td align="center">
<INPUT type="radio" ID="plan2" NAME="Plan" VALUE="Horse Value" onclick="onclick2(this, 3, 4, 2);">
</td>
<td align="center">
<INPUT type="radio" ID="plan3" NAME="Plan" VALUE="Horse Cover" onclick="onclick2(this, 5, 6, 3);">
</td>
<td align="center">
<INPUT type="radio" ID="plan4" NAME="Plan" VALUE="HiXcess" onclick="onclick2(this, 7, 8, 4);">
</td>
</tr>

Thanks

whoisgregg

3:12 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think this will solve your problem, it'll be more work to remove the color... :)

function onclick2(obj,varOne,varTwo,varTre){
obj.parentNode.style.backgroundColor = "white";
}