<?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: Hidden Field values not writing to database</title>
		<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database</link>
		<description>Gravity Support Forums Topic: Hidden Field values not writing to database</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 15:37:56 +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/hidden-field-values-not-writing-to-database" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33879</link>
			<pubDate>Tue, 30 Aug 2011 02:45:57 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33879@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Glad you got it working.  Thanks for the update.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33839</link>
			<pubDate>Mon, 29 Aug 2011 15:42:43 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33839@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Trust you are all safe...&#60;/p&#62;
&#60;p&#62;Just a quick update. After a lot of struggling I added a pre_submission_handler function and I just used $_POST[&#34;input_11&#34;] = $uniqueID;&#60;/p&#62;
&#60;p&#62;This works! I know this is not the correct way to dynamicaly populate a field, but it's the only way that works.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33566</link>
			<pubDate>Thu, 25 Aug 2011 14:54:06 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33566@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Chris, Thanks for looking into this and please feel free to point out ANY syntax errors. I have been thrown in the deep end here and I am learning my way through php :-)&#60;/p&#62;
&#60;p&#62;My code : &#60;a href=&#34;http://www.pastie.org/2429277&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/2429277&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Basically I am getting values from the database and populating a drop down list (which is working) Then I have two hidden fields for unique ID and for the team name. For now I was just focussing on the Unique ID.&#60;/p&#62;
&#60;p&#62;lines 60 - 63 returns the correct values, so I know my variables are working.&#60;br /&#62;
lines 161 - 165 is the function I am using at the moment to see if I could get it to work. And basically if I put in there $value = 'boom!' then it works and the value is dynamically placed in the text box.&#60;/p&#62;
&#60;p&#62;I can even echo the value passed to that function and get the correct value returned. But as soon as I use the uniqueID in the return statement, the value does not get passed to the form. It is VERY strange... I can give you full access to this server if it will help, just let me know where I must mail the details.&#60;/p&#62;
&#60;p&#62;Thanks again! I owe you guys A LOT!&#60;/p&#62;
&#60;p&#62;The site is topweddingphotos.com (developmet server)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33546</link>
			<pubDate>Thu, 25 Aug 2011 11:07:10 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33546@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;vixvii can you post your actual code to pastie.org or pastebin.com and explain what should be happening, and what is actually happening?  Looking at these edited copies has me confused and there are a couple syntax errors in there that might just be from editing to display them here.&#60;/p&#62;
&#60;p&#62;Please post the actual functions.php.  Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33390</link>
			<pubDate>Wed, 24 Aug 2011 02:37:29 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33390@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Just to update... When I use this with the above code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_your_parameter&#38;#39;, &#38;#39;my_custom_population_function&#38;#39;);
function my_custom_population_function($value){
    echo $value;
	$test = &#38;#39;WC11006&#38;#39;;
	return $test;
	//return $value;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The value WP11003 is echoed and the field is populated with WC11006 - so it &#34;works&#34;. But if I add $test = $value; or return $value directly it doesn't work at all. Must I convert $value to a certain type?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33389</link>
			<pubDate>Wed, 24 Aug 2011 01:48:36 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33389@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks once again Carl - I think I am clearly missing something and my hacking skills are failing me...&#60;/p&#62;
&#60;p&#62;This is what I have :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_your_parameter&#38;#39;, &#38;#39;my_custom_population_function&#38;#39;);
function my_custom_population_function($value){
    //return &#38;#39;boom!&#38;#39;;
	return $value;
}

add_filter(&#38;quot;gform_pre_render_16&#38;quot;, populate_comp_dropdown);
function populate_comp_dropdown($form){

$unique_id = &#38;quot;WP11003&#38;quot;;
my_custom_population_function($unique_id);
return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If I swap the comment marks and run return 'boom!'; in the function it works, but passing a value doesn't. Also, if I add a echo $value; just before the return, I do get the correct value displayed. Am I misunderstanding this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33363</link>
			<pubDate>Tue, 23 Aug 2011 17:47:04 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">33363@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you are populating standard fields (read: not checkbox or drop down but standard inputs) dynamically you should be doing it using this method:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Not via the pre render hook.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33359</link>
			<pubDate>Tue, 23 Aug 2011 17:29:58 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33359@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Carl, I might be doing something wrong, but I am populating them the same way I use for other forms that are working. Maybe not the best way? I had a look at the tutorial, but not 100% clear on it... Will I need to write a hook for every field I populate?&#60;/p&#62;
&#60;p&#62;Here's my code : &#60;a href=&#34;http://www.pastie.org/2418836&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/2418836&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I populate them on line 43 and 44
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33349</link>
			<pubDate>Tue, 23 Aug 2011 16:39:10 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">33349@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't know how you are populating the fields dynamically.  If they aren't showing up, they aren't being populated.   I'm assuming you are populating these hidden fields dynamically.  Make sure you are doing it correctly.  Here is a tutorial:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vixvii on "Hidden Field values not writing to database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-values-not-writing-to-database#post-33348</link>
			<pubDate>Tue, 23 Aug 2011 16:37:40 +0000</pubDate>
			<dc:creator>vixvii</dc:creator>
			<guid isPermaLink="false">33348@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a couple of hidden fields on my form that gets dynamically populated. If I do a &#60;/p&#62;
&#60;p&#62;&#60;code&#62;echo &#38;quot;&#38;lt;h1&#38;gt;Team : &#38;quot; .$_POST[&#38;quot;input_8&#38;quot;] .&#38;quot;&#38;lt;/h1&#38;gt;&#38;quot;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I get the correct value returned, but when I press the submit button this value is not written to the database, only the 3 visible fields' data is entered into the database. It isn't even making a entry for the field in the database...&#60;/p&#62;
&#60;p&#62;Any ideas?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
