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.

Pre-populate fields with Cookie data

  1. Hi,

    I'm wondering if it's possible to pre-populate a few of the fields within the gravity form with cookies. Basically, I have a small form that says, "get started," where the user only enters a few bits of information. If they click to continue, the info they entered is stored in the form of a cookie and they are taken to the page with my gravity form. These few fields that they filled out are in the gravity form and rather than have them fill them out again, I'd like to pre-populate the fields with the cookie info.

    Is this possible using this plugin? Any ideas how or where I should start?

    Cheers,
    Brad

    Posted 14 years ago on Friday July 2, 2010 | Permalink
  2. Yes it's possible. However you would have to write custom code you would place in your functions.php file to do so and you would have to write the code to store the cookie.

    Here is a post discussing how to setup a field so it can be pre-populated and then how to pre-populate the field using an API hooks and custom PHP:

    http://forum.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3212

    You first have to edit the field you want to pre-populate, go to the advanced tab and check the "Allow field to be populated dynamically" checkbox and then give the field a parameter name. The parameter name is then used to target the field using code. The thread I link to above discusses this.

    You would do the same thing as in this example except instead of setting the value of the field to a variable or some text you would read the cookie you created and use the value in the cookie.

    If you need assistance with this customizations we would be glad to recommend a consultant with Gravity Forms experience that could assist you.

    Posted 14 years ago on Friday July 2, 2010 | Permalink

This topic has been resolved and has been closed to new replies.