My issue is that I am wanting to create multiple forms but use only one template to style the form, so what I want to do is pass the post id from multiple forms to the one template.
So lets say I have 5 different forms, when the user hits submit, I need to send the post id of that specific form over the one style template page (I am trying to avoid creating multiple style templates).
I can easily pull over the post id to the style template but I am not sure how (or if it is possible) to substitute the post id:
If I have this in the form:
<input name="Name" type="text" value="<?php the_sub_field('name'); ?>" />
I then pull in this field in the style template by using:
I can do something similar with the post ID and naming it
$post_id, I’m just not sure how (or if) I can then us that in the repeater below to pull in the specific post ID
<?php if(get_field('choice_menu', '$post_id'));?> <?php while(has_sub_field('choice_menu', '$post_id'));?>
Is it possible? Does that make sense in what I am trying to do?
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!
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.