mercredi 27 mai 2015

Toggle multiple checkboxes, but not all on select

In an existing project, a table is filled with a checkbox and a description in each row. headlines followed by several rows of the same group which should be toggled pon checking the headline:

for($i = 1; $i < count($inhaltIDList); $i++)
{
    echo '<tr><td><input type="checkbox" disabled name="1" value="">
        </td>'."\n";
    echo "<td><strong>Description"</strong></td></tr>\n";

    for($x = 0; $x < count($inhalt); $x++)
    {
        echo '<tr><td><input type="checkbox"  name="absatz[]"         value="'.$inhaltIDList[$i].','.$absatzbuchstaben[$x].'" '.$check.'>        </td>'."\n";
        echo '<td>'.$inhalt[$x].'</td></tr>'."\n";
        $check = '';
    }
}

How to toggle all checkboxes from the second for-loop upon selecting the one from the first loop?




Aucun commentaire:

Enregistrer un commentaire