mardi 6 juin 2017

How do I set a checkbox to unchecked based on php var - previous posts don't fix my issue

I have a php var ($testx) set to 0.

Html code looks like this:

<input type='checkbox' name='test_cb' id='test_cb' checked=<?= $testx == true ? 'checked' : '0' ?>></input>

The checkbox is always checked even though the php var being checked is false. I must be missing something obvious.




Aucun commentaire:

Enregistrer un commentaire