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.

Pass form data to receipt page?

  1. derekalvarez
    Member

    Is there a way I can pass the form data onto a receipt page? Here's the form:
    http://ontopinternetmarketing.com/forms-demo/casb20/

    This page would have a certificate with their name on it:
    http://ontopinternetmarketing.com/forms-demo/casb20/print/

    How can I make this happen? I've looked all over the forums and haven't been able to find the answer.

    Posted 12 years ago on Monday August 22, 2011 | Permalink
  2. Is "print" just another WordPress page (page 15?) If so, you will want to use "Redirect" in your confirmation settings, and redirect to this page http://ontopinternetmarketing.com/forms-demo/casb20/print/ . Then, you need to need to check the box "Pass Field Data Via Query String" and type something like this:

    fname=

    and then after the equal sign, use the Insert form field drop down to insert the merge tag for the field you want to pass from the form, so that the textarea looks like this:

    fname={Name (First):1.3}

    Then type &lname= and insert the next merge field (last name.) When you're done, it will look like this:

    fname={Name (First):1.3}&lname={Name (Last):1.6}

    Now that you are sending the values to the second page (the print page) you need to use them there somehow. This could be by using a special page template that looks for those two values. This would require a small amount of PHP in your functions.php or the special page template you use for this print page.

    However, that leaves this pretty open to abuse. Anyone could submit a URL like
    http://ontopinternetmarketing.com/forms-demo/casb20/print/?fname=MyFirst&lname=MyLast and get the certificate.

    Does the email notification to the user not provide enough of a certificate? You can style that however you want and it will be emailed to the person who submitted the form.

    Posted 12 years ago on Tuesday August 23, 2011 | Permalink
  3. derekalvarez
    Member

    I put this aside for awhile, but I'm back at it!

    Here's where I'm at now... I've set up a form page that sends an HTML email receipt, but I would also like the page to pass the data onto a page on the website.

    Here's where the form is...
    http://recycleirvine.org/casb20/

    Here's the receipt page that I can't seem to get working...
    http://recycleirvine.org/casb20/receipt/

    I've added this code to my functions.php file, but I'm not sure what else I should be doing?
    /** Gravity Forms Receipt */
    add_filter("gform_post_data", "change_post_type", 1645);
    function change_post_type($post_data, $form){
    //only change post type on form id X
    if($form["id"] != 6) // You need to change your form ID here
    return $post_data;

    // Add other page data to change
    $post_data["post_type"] = "page";
    $post_data["post_parent"] = 466;
    return $post_data;
    }

    Posted 12 years ago on Wednesday November 16, 2011 | Permalink
  4. Looking at your receipt page I see Gravity Forms merge tags. Those merge tags aren't going to get replaced because it's outside the scope of Gravity Forms.

    I'm not sure how the custom code you posted above plays into this.

    If what you want to do is display the form submission data on that receipt page, then you need to pass the form field data to that page via the query string as Chris outlined above.

    Your receipt page then needs to read and display the query string values and insert them where you want them displayed.

    Posted 12 years ago on Wednesday November 16, 2011 | Permalink
  5. derekalvarez
    Member

    Thanks Carl,

    How do I make my receipt page read the query string? What code do I need to add to it?
    Will it then display the data the way I have set up?

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  6. If you pass it to your receipt page via the query string using the Redirect confirmation method, then you will need to make your receipt page read and display the query string values using PHP. So you'd have to add PHP to your custom receipt page to read and display the query string items.

    If this is above your head in terms of PHP knowledge then you could go about this another way. Use a WordPress page for your receipt, and then use a plugin that lets you display query string values using shortcodes such as this one:

    http://wordpress.org/extend/plugins/url-params/

    You would still need to use the Redirect confirmation method (not the Page method) and then put the full path URL to your WordPress page and then configure the query string builder to pass the form field values.

    Then on your receipt page you could use that shortcode plugin to display the query string values wherever you want to display them.

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  7. derekalvarez
    Member

    Thanks again Carl,

    I added the plugin and set up the form to redirect to this url...
    http://recycleirvine.org/casb20/receipt/

    I set up the query string like this...
    id={entry_id}fname={Name: (First):3.3}&lname={Name: (Last):3.6}

    But I think I must be using the wrong names on the receipt page?
    http://recycleirvine.org/casb20/receipt/

    Example code: [ urlparam param="fname" /] [ urlparam param="lname" /]

    Should I be typing something else instead of "fname" or "lname"?

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  8. It doesn't look like that page is parsing the [urlparam] shortcode. Either something is wrong with the shortcode, something is wrong with that plugin, OR your template isn't configured to parse shortcodes. My initial guess is however that page is configured it isn't parsing shortcodes for the content.

    Shortcodes aren't parsed automatically by WordPress. The do_shortcode function must be used on the content to trigger the shortcode parser. That could be what the problem is here. Here is documentation on the do_shortcode function in WordPress:

    http://codex.wordpress.org/Function_Reference/do_shortcode

    I have no access to that WordPress theme template file to be able to determine for sure if this is what the problem is. But if where the_content is output in that theme template it's not being passes through the do_shortcode function or there is nothing in your functions.php file doing this for you... then the shortcodes won't be parsed and they will simply display on the page.

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  9. derekalvarez
    Member

    Here's the code I'm using in the page template, still no dice...

    <?php
    /*
     * Template Name: Receipt Page
     * This template displays only content; no header, footer, etc
     */
    
    // Allow Shortcodes
    add_filter('the_content', 'do_shortcode', 11);
    
    // Remove Header
    remove_action('genesis_header', 'genesis_header_markup_open', 5);
    remove_action('genesis_header', 'genesis_header_markup_close', 15);
    remove_action('genesis_header', 'genesis_do_header');
    
    // Remove the page title
    remove_action('genesis_post_title', 'genesis_do_post_title');
    
    // Remove Navigation
    remove_action('genesis_after_header', 'genesis_do_nav');
    remove_action('genesis_after_header', 'genesis_do_subnav'); 
    
    // Remove Breadcrumbs
    remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
    
    // Remove Footer
    remove_action('genesis_footer', 'genesis_do_footer');
    remove_action('genesis_footer', 'genesis_footer_markup_open', 5);
    remove_action('genesis_footer', 'genesis_footer_markup_close', 15);
    
    // Remove Top Search
    remove_action('genesis_after_header', 'agentpress_top_search' );
    
    // Remove Footer Widgets
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );  
    
    genesis(); // requires Genesis 1.3+

    Can you recommend someone who can take care of this for me? I'm willing to pay for it.

    Posted 12 years ago on Saturday December 10, 2011 | Permalink
  10. Derek, you can find help here or post your own job there as well.

    http://www.gravityhelp.com/forums/topic/how-the-job-board-works

    Posted 12 years ago on Saturday December 10, 2011 | Permalink