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.

Sessions - Remember field entries

  1. Hi,

    I've tried looking for a thread that solves this riddle but couldn't find a clear answer, if this is possible with Gravity Forms then I will buy in straight away...ok...here goes:

    We are running a Wordpress site, latest build and we want to create a single form that is embedded into a page template via the php function.

    So each page will carry different information but the same single form will be built into the template. We want random users to just fill out the form once and while browsing the site and through other pages if they want to 'submit' their information to another page they won't have to fill out the same form again, it will remember their information and have it pre-filled.

    Also a way for the form when submitted each time needs to reference the page ID - we need to know which page the submissions came from since it will be the same form, just different page titles.

    Just to clarify, this won't be for members of the Wordpress site, just random visitors that have to fill out the form once and have it pre-filled for the rest of their time on the site. I think seeing as it would be the SAME form each time it should be more feasible, but what do I know!

    Please let me know as soon as you can,

    THANK YOU!

    Jay

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  2. Currently Gravity Forms doesn't save and pre-populate field values, so it doesn't have the feature you mentioned where it would pre-populate fields based on previous entries.

    You could do this as a customization by using the available API hooks to set a cookie when the form is submitted, and then read from that cookie when the form is displayed. It's possible to do as a customization. Gravity Forms is extremely customizable through the extensive array of API hooks and filters.

    Gravity Forms stores the page/post ID as well as the URL of the page/post the form was submitted from automatically as part of the form entry data.

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  3. Okay that being said, is there any more documentation / help that could absolutely help me with this? I'd be in the same place as I started if I bought Gravity Forms and attempted this... I'm quite a newbie when it comes to API hooks / cookies / sessions...

    ANY help would be massively appreciated.

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  4. If you are familiar with how to create and read a cookie using PHP it should be pretty simple to do.

    You would use the gform_post_submission hook to set/create a cookie when the form is submitted and store the values of the fields you want to store in a cookie. The gform_post_submission hook is documented here:

    http://www.gravityhelp.com/documentation/page/Gform_post_submission

    You would then use the hooks for dynamic population to read that cookie and populate the fields. A tutorial on how to dynamically populate fields can be found here:

    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

    You would have to read up on how to create cookies using PHP if you don't already know how to do this, you could try searching Google for this as it's not Gravity Forms specific.

    Posted 12 years ago on Thursday July 21, 2011 | Permalink