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.

Passing custom field values to Gravity forms (pre-populate)

  1. wendy
    Member

    Hello,
    Before I forget to add it, here is a link to the site (http://www.xntrixart.com/). Click the first image. Rather than Buy Now, I would like to link to a Gravity form page.

    What I would like to do is to add the price for the artwork as a custom field if possible and then when the user clicks on a link (or button), have that value pre-populate on the resulting form on a separate page (or modal form) that it links to. I have been all over the forum and cannot find a good example that I can modify for my use. Can someone please provide such an example? The closest thing to what I think might be the best solution are the hooks (http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population) but I need an example that will show me how to pull in that custom price field (return 'boom!' doesn't help in my case). The theme provides an input field for the custom post type (projects) that is used for a description. I can add a link or button (to the Gravity Form page) after the description here but I cannot use shortcodes.

    My other option, I guess is to skip the Gravity Forms completely and just use a "Buy Now" paypal button, but I want to be able to capture the name, email and delivery address via the Gravity form.

    Any help is greatly appreciated! I am always open to other suggestions.

    Thanks for your assistance and Happy New Year!

    Posted 12 years ago on Friday December 30, 2011 | Permalink
  2. Hey Wendy, what you will want to do is, on your form page, the product field - You will want to edit that field and click the Advanced tab and then allow that field to be populated dynamically. There is a checkbox to activate that. There, you can specify paramater names. See this screenshot:

    http://grab.by/btPx

    After that, you can now construct your URL to pass the values in, so this can be the link that goes on your button or text link from the product to the form. In your case, it would be something like this:

    http://www.xntrixart.com/purchase/?Price=100.00

    If you want to show the form there instead of linking to it, you can pass this via a shortcode:

    [gravityform id=1 field_values='Price=100.00'] Where 1 would be the ID of your form. Let me know how it goes!

    EDIT - Scratch the shortcode - just read that you can't use them, but at any rate that's how that would be achieved if you could. :)

    Posted 12 years ago on Friday December 30, 2011 | Permalink