mercredi 21 août 2019

How to keep checkbox array checked after submission

I have the following codes to show dynamic checkboxes.

echo '<input class="checkBoxes" type="checkbox" name="checkBoxArray[]" value="'.$oaName.'" style="float:left;"'; ?> <?php if(isset($_POST['checkBoxArray'])) echo "checked='checked'"; ?> <?php echo '>'; ?>

But after submission, all checkboxes are showing checked. Does anyone know what am i doing wrong here?

Edit 1 checkBoxArray[] are checkboxes names which are getting from database




Aucun commentaire:

Enregistrer un commentaire