ecco qua :gren:
codice:
<form name="form1">
<table>
<tr bgcolor=#f9f4e1 id="cc_0">
<td>
<input type="checkbox" name="msg_0" value=1 onclick=if(msg_0.checked){cc_0.bgColor='#F1EAD1'}else{cc_0.bgColor='#f9f4e1'}>
</td>
<tr bgcolor=#f9f4e1 id="cc_1">
<td>
<input type="checkbox" name="msg_1" value=1 onclick=if(msg_1.checked){cc_1.bgColor='#F1EAD1'}else{cc_1.bgColor='#f9f4e1'}>
</td>
</tr>
<tr bgcolor=#f9f4e1 id="cc_2">
<td>
<input type="checkbox" name="msg_2" value=1 onclick=if(msg_2.checked){cc_2.bgColor='#F1EAD1'}else{cc_2.bgColor='#f9f4e1'}>
</td>
</table>
poi ho invece un checkbox che mi spunta tutti i checkbox, questo è il codice:
<script>
function sel(truefalse){
with(document.form1){
for(i=0;i<elements.length;i++){
thiselm = elements[i];
if(thiselm.name.substring(0,3) == 'msg'){
thiselm.checked = truefalse
colonna=document.getElementById('cc_'+thiselm.name.substr(4))
if(thiselm.checked)colonna.bgColor='#F1EAD1'
else colonna.bgColor='#f9f4e1'
}
}
}
}
</script>
<input type="checkbox" value="tutti" onclick="sel(this.checked)">
</form>