PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Dynamically populate form field using referring WP Post details

  1. andrew1911
    Member

    I'm in the process of building an online booking site for a client where they can purchase attendance at seminars. I'm using a WooTheme which is perfect for the job, but I'd like to use a better booking form : http://demo.woothemes.com/?name=diarise

    Each seminar is a categorised post; I'd like to pass through to the booking form the title of the referring post and the date, so that the user has a smoother ride through the booking process.

    I've experimented with the {referer}{embed_post:post_title} option in the Default Values options of the respective form field but this doesn't work.

    Looking at the source code of the WooTheme booking form example, it looks like it's feasible using $_GET vars :

    if(isset($_POST['eventName']))
    {
    echo $_POST['eventName'];
    }
    elseif (isset($_GET['event_id']))
    {
    $woo_post = get_post($_GET['event_id']);
    if ($woo_post)
    {
    echo $woo_post->post_title;
    }
    }

    But I'm at a bit of a loss how to adapt my GravityForm to pick up the same variables - I was sort of hoping I could use the interface, being a bit weaker in the code department!

    Any thoughts would be very much appreciated.

    Posted 14 years ago on Monday December 6, 2010 | Permalink