If value of radio button from mysql is "Hadir", then .hadir should be checked and .terlambat fadeIn(jQuery) and enabled when the page has been loaded.
Otherwise ("Sakit", or "Izin", or "Absen"), then .terlambat fadeOut (jQuery) and disabled.
Also, it's not only 1 fieldset, I have input type = hidden so I can count how many fieldset are there.
<fieldset id="number'.//get id from php'">
<tr>
<td class="text-center">'.//get id from php.'</td>
<td>'.//get name from php.'</td>
<td>
<label class="radio-inline"><input class="hadir" type="radio" value="Hadir" name="kehadiran_siswa['.//get id from php.']">Hadir</label>
<label class="radio-inline"><input class="sakit" type="radio" value="Sakit" name="kehadiran_siswa['.//get id from php.']">Sakit</label>
<label class="radio-inline"><input class="absen" type="radio" value="Absen" name="kehadiran_siswa['.//get id from php.']">Absen</label>
<label class="radio-inline"><input class="izin" type="radio" value="Izin" name="kehadiran_siswa['.//get id from php.']">Izin </label>
<label class="checkbox-inline terlambat"><input class="terlambat" type="checkbox" value="Terlambat" name="keterangan_siswa['.//get id from php.']"> Terlambat</label>
</td>
</tr></fieldset><input type="hidden" value="'//length from php" name="length"/>
Aucun commentaire:
Enregistrer un commentaire