I'm trying o change the background color of a div if a checkbox is checked.
It's working for the div outside the loop, but not for the ones inside. All the variables appear fine, so i think is a syntax error.
Thanks!
<input type="checkbox" name="check0" value='1' <?php echo ((${executed_mod0}=="1")? "checked" : ''); ?> onchange='this.nextSibling.style.backgroundColor = this.checked ? "#6EDBFF" : "white";'><input type="text" name="procedure0" value="<?php echo $repair_mod0;?>">
<?php
$i=1;
while($i<$nrpm)
{
echo '<br><input type="checkbox" name="check'.$i.'" value="1"'. ((${executed_mod.$i}=="1")? "checked":"").' onchange="this.nextSibling.style.backgroundColor = this.checked ? \"#6EDBFF\" : \"white\";"><input type="text" name="procedure'.$i.'" value="'.${repair_mod.$i}.'">';
$i++;
};
?>