vendredi 17 mars 2017

Check box by default, if unchecked, stay unchecked

I have a checkbox with this code

<td align="right">Include In Top Sellers?</td>
                          <td>
                            <input type="hidden" name="include_top"
                            value="0"><input type="checkbox"
                            name="include_top"
                            id="include_top"
                            value="1" <?php echo (($_POST["include_top"] == "1") or ($res["include_top"] == "1")) ? "checked='checked'" : ""; ?>
                            autocomplete="off"/>
                          </td>
                        </tr>

I need to have this box checked by default but also allow it to be unchecked and stay unchecked if saved.




Aucun commentaire:

Enregistrer un commentaire