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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.