mercredi 12 juillet 2017

Checkbox not returning checked

I have the following code:

<div><input type="checkbox" name="fhaac_publicly_queryable" value="<?php
    if (isset( $_POST ['fhaac_publicly_queryable'])) {
        echo  "checked";
    } elseif ($fhaac_publicly_queryable == "on") {
    echo "checked";
    }
?>" name="fhaac_publicly_queryable" /> Publicly Queryable on a search</div>

I have the content saving to the database, but on save, the checked check box disappears and I can't figure out how to query so it returns. Any ideas?

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire