<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Save user input in cookie and prepopulate form</title>
		<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form</link>
		<description>Gravity Support Forums Topic: Save user input in cookie and prepopulate form</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:41:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-119539</link>
			<pubDate>Fri, 11 Jan 2013 13:05:49 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">119539@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for posting that.  I believe you can no longer use that notation. In PHP version 5.4 and later it will raise a fatal error.  In PHP 5.3, it will raise a warning.  What PHP version are you using?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chillybin on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-118823</link>
			<pubDate>Thu, 10 Jan 2013 21:31:06 +0000</pubDate>
			<dc:creator>chillybin</dc:creator>
			<guid isPermaLink="false">118823@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;FYI, in order to get this working on my server (it was causing 500 errors) I have had to remove the &#38;amp; from before $field&#60;/p&#62;
&#60;p&#62;foreach($form[&#34;fields&#34;] as &#38;amp;$field){&#60;/p&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;p&#62;foreach($form[&#34;fields&#34;] as $field){&#60;/p&#62;
&#60;p&#62;Hope that helps
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-98103</link>
			<pubDate>Sun, 02 Dec 2012 22:46:32 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">98103@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you share a link to the page where the form is embedded so we can check it out?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Caleb44 on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-98075</link>
			<pubDate>Sun, 02 Dec 2012 20:48:25 +0000</pubDate>
			<dc:creator>Caleb44</dc:creator>
			<guid isPermaLink="false">98075@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That is really nice.  I tried it out, but it put the email field in the first, last and email fields in the form. Is that maybe an issue with how the cookie is being set?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cwidhelm on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-57460</link>
			<pubDate>Wed, 02 May 2012 14:10:00 +0000</pubDate>
			<dc:creator>cwidhelm</dc:creator>
			<guid isPermaLink="false">57460@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In case anyone wants to try this out.  It will auto populate any field that is marked as &#34;Allow field to be populated dynamically&#34; with it's previous value from a cookie.&#60;/p&#62;
&#60;p&#62;Add this to your functions.php&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;pre_submission_handler&#38;quot;);
function pre_submission_handler($form_meta) {
        $saveVars = array(&#38;quot;first&#38;quot;, &#38;quot;last&#38;quot;, &#38;quot;email&#38;quot;, &#38;quot;phone&#38;quot;);
        foreach($form_meta[&#38;quot;fields&#38;quot;] as $field) {
                if( $field[&#38;quot;allowsPrepopulate&#38;quot;] ){
                        if( is_array($field[&#38;quot;inputs&#38;quot;]) ){
                                foreach($field[&#38;quot;inputs&#38;quot;] as $sub){
                                        $val = $_POST[&#38;quot;input_&#38;quot; . str_replace(&#38;quot;.&#38;quot;, &#38;quot;_&#38;quot;, $sub[&#38;quot;id&#38;quot;])];
                                        setcookie(&#38;quot;gf_&#38;quot;.$sub[&#38;quot;name&#38;quot;], $val, time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true);
                                }
                        }else{
                                $val = $_POST[&#38;quot;input_&#38;quot; . $field[&#38;quot;id&#38;quot;]];
                                setcookie(&#38;quot;gf_&#38;quot;.$field[&#38;quot;inputName&#38;quot;], $val, time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true);
                        }
                }
        }
}

add_filter(&#38;quot;gform_pre_render&#38;quot;, &#38;quot;add_auto_update_filters&#38;quot;);
$contego_callbacks = array();
function add_auto_update_filters($form){
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
                if( $field[&#38;quot;allowsPrepopulate&#38;quot;] ){
                        if( is_array($field[&#38;quot;inputs&#38;quot;]) ){
                                foreach($field[&#38;quot;inputs&#38;quot;] as $sub){
                                        $fieldName = $sub[&#38;quot;name&#38;quot;];
                                        add_filter(&#38;quot;gform_field_value_&#38;quot; . $fieldName, function($fieldName) use ($fieldName){
                                                return $_COOKIE[&#38;quot;gf_&#38;quot; . $fieldName];
                                        });
                                }
                        }else{
                                $fieldName = $field[&#38;quot;inputName&#38;quot;];
                                add_filter(&#38;quot;gform_field_value_&#38;quot; . $fieldName, function($fieldName) use ($fieldName){
                                        return $_COOKIE[&#38;quot;gf_&#38;quot; . $fieldName];
                                });
                        }

                }
        }
        return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>cronkled on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-54333</link>
			<pubDate>Thu, 05 Apr 2012 07:47:24 +0000</pubDate>
			<dc:creator>cronkled</dc:creator>
			<guid isPermaLink="false">54333@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks everyone for this. This is really a great solution. &#60;/p&#62;
&#60;p&#62;I'm also having trouble setting fname and lname as well as address fields. It looks to me that there is an issue setting with multi-input fields, but I think everyone above already figured that out. &#60;/p&#62;
&#60;p&#62;I'd love to see a resolution if anyone comes up with one. &#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jackrabbit on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-54032</link>
			<pubDate>Mon, 02 Apr 2012 19:23:12 +0000</pubDate>
			<dc:creator>jackrabbit</dc:creator>
			<guid isPermaLink="false">54032@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl,&#60;/p&#62;
&#60;p&#62;Yes the session variable is not outputting. So there is a mistake with setting the value but how should i get it working? Tried with different parameter_name for first and last name field. Same issue with address fields, dropdown menu and radio buttons.&#60;/p&#62;
&#60;p&#62;Any suggestions/guidelines will be great.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>CoastalX on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-53529</link>
			<pubDate>Tue, 27 Mar 2012 02:20:07 +0000</pubDate>
			<dc:creator>CoastalX</dc:creator>
			<guid isPermaLink="false">53529@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is a great thread. Thanks for keeping it going. I would love to see this built into Gravity Forms. This is VERY useful functionality if you're using Gravity Forms for a lot of lead forms on your site and you don't want people to have to enter their info multiple times on different forms.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>barak on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-47192</link>
			<pubDate>Tue, 24 Jan 2012 05:42:00 +0000</pubDate>
			<dc:creator>barak</dc:creator>
			<guid isPermaLink="false">47192@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;can i add a check box in the end of every form that the viewer can mark if he want to save the info for other form or not?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Scott on "Save user input in cookie and prepopulate form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/little-hint-from-me-save-user-input-in-cookie-and-prepopulate-form#post-35894</link>
			<pubDate>Wed, 21 Sep 2011 15:40:43 +0000</pubDate>
			<dc:creator>Scott</dc:creator>
			<guid isPermaLink="false">35894@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Understandable.  Hoping that someone can come up with a solution because this idea is awesome!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
