dimanche 13 octobre 2019

how to change checkbox value in php

I have a dental examination algorithm. There will be many checkboxes with important diseases and symptoms. By default some symptoms (checkboxes) should be checked. Then user can change the value in session. Right now my code looks like this:

if ($xhiv == 1) {
echo "<span class='red'> HIV </span> <input type='checkbox' name='xhiv' value='1' checked> ; ";
}
else {
echo " HIV  <input type='checkbox' name='xhiv' value='0'> ; ";
}

live example




Aucun commentaire:

Enregistrer un commentaire