Support

Account

Home Forums General Issues Dynamically set form ID Reply To: Dynamically set form ID

  • That’s how I’ve made it. But it won’t work 🙁
    This is my form:

    acf_form_head();

    $fields = array(
    ‘field_5d88ebc436c1d’, // s_body_size
    ‘field_5d88ec8636c1e’, // s_body_type
    ‘field_5d88ecc036c1f’ // s_head_size
    );
    acf_form(array(
    ‘id’ => ‘form-‘.$post->ID,
    ‘post_id’ => $post->ID,
    ‘new_post’ => array(
    ‘post_type’ => ‘custom_size’,
    ‘post_status’ => ‘publish’,
    ),
    ‘post_title’ => false,
    ‘post_content’ => false,
    ‘uploader’ => ‘basic’,
    ‘fields’ => $fields,
    ‘submit_value’ => ‘Update Size’
    ));

    Placed in loop ( while(have_posts()): the_post() )

    And it gives errors. Form itself has own ID, but inputs not. (Found 7 elements with non-unique id #acf-field_5d88ebc436c1d) as all fields of the form have same id’s