View Single Post
Old 09-27-2007, 12:52 AM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Try this. Just set the onclick() action on the checkboxes to call change_row_colour(this). Like so:

Code:
onclick="change_row_colour(this)"
Here's the main part though:

javascript Code:
<script type="text/javascript">

    var szColorTo = '#0000FF';
    var szColorOriginal = '#FF0000';
   
    function change_row_colour(pTarget)
    {
        var pTR = pTarget.parentNode.parentNode;
       
        if(pTR.nodeName.toLowerCase() != 'tr')
        {
            return;
        }
       
        if(pTarget.checked == true)
        {
            pTR.style.backgroundColor = szColorTo;
        }
        else
        {
            pTR.style.backgroundColor = szColorOriginal;
        }
    }

</script>
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.

Last edited by Wildhoney : 12-05-2007 at 03:46 AM.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote