Home Forums ACF PRO Check Boxes


Check Boxes

  • Hi All.
    I’m wondering if you can help.
    I’ve got a form which upon submission updates a custom post type with some ACF fields.
    All is great… Apart from, sometimes we need to view that post again, update it and repost it by hitting submit.

    I’ve got the post’s fields showing previous entries in all the text boxes etc… however I’m struggling with checkboxes…

    I’m using the following which works well for submitting but it’s not showing whether the box was previously ticket.

    <div class="checkbox">
              <label><input type="checkbox" name="backdrop" <?php echo get_field("are_you_bringing_a_back_drop")[0]=="Yes" ? "checked='checked'" : "" ?> >Yes</label>

    Can you help me?


  • You’re using a regular checkbox field. A normal checkbox field for HTML does not submit a value if it is not checked. Checking the submission of a checkbox field in PHP goes something like

    if (isset($_POST['backdrop'])) {
      // box is checked
    } else {
      // box is not checked

    Any reason why your not using acf_form()?

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Check Boxes’ is closed to new replies.