Home Forums General Issues ACF checkbox update


ACF checkbox update

  • I have a big form with manny fields like text, img, gallery…and now i need another field (checkbox), i have 2 checkbox fields with only one option, the only thing i need is when the form is submitted and the user checks the checkbox to be check in the backend…i don’t understand how to create the html what value to put in for the field to be check.

    this are the fields:

    $fields = array(
    ‘field_5aeda3aee788b’ => $_POST[‘postAuthor’],
    ‘field_5aedb0ec1d441’ => $_POST[‘postJob’],
    ‘field_5aedbf6b4ba92’ => $_POST[‘postTeam’],
    ‘field_5aedbf814ba93’ => $_POST[‘postOffice’],
    ‘field_5aedbf8f4ba94’ => $_POST[‘postContributors’],
    ‘field_5aedbf984ba95’ => $_POST[‘postContributorsOut’],
    ‘field_5aedbfa14ba96’ => $_POST[‘postLocation’],
    ‘field_5aedbfa94ba97’ => $_POST[‘postClient’],
    ‘field_5aedbfb04ba98’ => $_POST[‘postBudget’],
    ‘field_5aedbfb94ba99’ => $_POST[‘postConstructionArea’],
    ‘field_5aedbff54ba9a’ => $_POST[‘postAddress’],
    ‘field_5aedc00e4ba9b’ => $_POST[‘postEmail’],
    ‘field_5aedc0164ba9c’ => $_POST[‘postPhone’],
    ‘field_5aedc0284ba9e’ => $_POST[‘postCIL’],
    ‘field_5b02d0a7ae92c’ => $_POST[‘postProjectDescription’],

    for ($i=0; $i < count($fields); $i++) {
    update_field(array_keys($fields)[$i], array_values($fields)[$i], $post_id );

Viewing 1 post (of 1 total)

The topic ‘ACF checkbox update’ is closed to new replies.