Support

Account

Home Forums General Issues Pass the Post ID to another page Reply To: Pass the Post ID to another page

  • Thanks, Elliot.

    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:
    $Name

    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?