Hey,

i`ve made a little script that allows you to hover over a table and the background color will change.. than when you move out it will change back to default.. that`s all fine.. the clicking part is the part that gives me the most pain.. at this moment you can click on it and the background color gets orange (like i want it) but now the problem is that i want 2 other things in it and i can`t get them working :S

you see a checkbox on the left.. i want to make it so that when the checkbox is checked the entire row gets orange.. when the chechbox is unchecked the entire row must be default again.. but i`m not getting that working.. also the checkbox must turn on/off when you click anywhere in that row.. not just on the checkbox itself.. any help would be verry nice

here is the script:
PHP Code:
<html>
<
head>
<
script type="text/javascript">
  function 
set_color(theRowactiondefault_colorhover_colorclick_color)
  {
    
//document.write("jhjhgjhgj");
    
theCells theRow.getElementsByTagName('td');
    if (
action == 'over')
    {
        
newColor hover_color;
    }
    if (
action == 'out')
    {
        
newColor default_color;
    }
    if (
action == 'click')
    {
        
newColor click_color;
    }
    
    var 
rowCellsCnt  theCells.length;
    var 
null;
    for (
0rowCellsCntc++)
    {
        
theCells[c].setAttribute('bgcolor'newColor);
    }
    

  }

</script>

</head>
<body>
<table>
  <tr class="normal" onmouseover="set_color(this, 'over', '#FFFFFF', '#FF0000', '#FFCC99');" onclick="this.onmouseout = function() {set_color(this, 'click', '#FFFFFF', '#FF0000', '#FFCC99');};" onmouseout="set_color(this, 'out', '#FFFFFF', '#FF0000', '#FFCC99');" onmousedown="set_color(this, 'click', '#FFFFFF', '#FF0000', '#FFCC99');">
    <td><input type="checkbox"></td>
    <td>abcdef</td>
    <td>fedcba</td>
  </tr>
  <tr class="normal" onmouseover="set_color(this, 'over', '#FFFFFF', '#FF0000', '#FFCC99');" onclick="this.onmouseout = function() {set_color(this, 'click', '#FFFFFF', '#FF0000', '#FFCC99');};" onmouseout="set_color(this, 'out', '#FFFFFF', '#FF0000', '#FFCC99');" onmousedown="set_color(this, 'click', '#FFFFFF', '#FF0000', '#FFCC99');">
    <td><input type="checkbox"></td>
    <td>abcdef</td>
    <td>fedcba</td>
  </tr>
</table>
</body>
</html> 
BTW.. this is my first javascript coding ever you can really get far with the javascript development information on mozilla

and to give another example how i want it.. i want it to behaive EXACTLY the same like phpmyadmin does when you want to select multiple columns.

Thanx alot.