samedi 20 juin 2020

PHP how to insert unchecked checkbox value

Need help. i have 5 checkboxes[] 3 is checked 2 unchecked

i want to insert all checkbox values but if checkbox is checked than insert value 1 and if unchecked insert 0

   <input id="answer" type="text" name="answer[]" /> //checked
   <input id="answer" type="text" name="answer[]" />
   <input id="answer" type="text" name="answer[]" /> /checked
   <input id="answer" type="text" name="answer[]" />
   <input id="answer" type="text" name="answer[]" /> //checked

if i check the length or size of field than it displays and insert only checked items but i want to insert unchecked also with value 0




Aucun commentaire:

Enregistrer un commentaire