<?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: Code to Populate a Hidden Field</title>
		<link>https://legacy.forums.gravityhelp.com/topic/code-to-populate-a-hidden-field</link>
		<description>Gravity Support Forums Topic: Code to Populate a Hidden Field</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 22:17:37 +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/code-to-populate-a-hidden-field" rel="self" type="application/rss+xml" />

		<item>
			<title>bfeldman on "Code to Populate a Hidden Field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-to-populate-a-hidden-field#post-12660</link>
			<pubDate>Sat, 13 Nov 2010 19:19:57 +0000</pubDate>
			<dc:creator>bfeldman</dc:creator>
			<guid isPermaLink="false">12660@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you David!  &#60;/p&#62;
&#60;p&#62;That's what I get for trying to &#34;impersonate a PHP programmer.&#34;  But the code itself (after fixing the variable name) ... actually worked!  Hooray!!!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Code to Populate a Hidden Field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-to-populate-a-hidden-field#post-12659</link>
			<pubDate>Sat, 13 Nov 2010 18:34:50 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">12659@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;PHP does not allow dashes in variable names. Try &#60;strong&#62;$hidden_byline&#60;/strong&#62; instead of &#60;strong&#62;$hidden-byline&#60;/strong&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bfeldman on "Code to Populate a Hidden Field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/code-to-populate-a-hidden-field#post-12612</link>
			<pubDate>Fri, 12 Nov 2010 19:20:16 +0000</pubDate>
			<dc:creator>bfeldman</dc:creator>
			<guid isPermaLink="false">12612@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am trying to populate a hidden field using the gform_pre_submission hook.  I am placing this code in custom_functions.php in my Thesis site.   Here is URL to form:&#60;br /&#62;
&#60;a href=&#34;http://www.halloweenfun.net/submit-site-review/&#34; rel=&#34;nofollow&#34;&#62;http://www.halloweenfun.net/submit-site-review/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Here is the code, but it is invalid, because it is &#34;crashing&#34; my custom_functions.php.&#60;br /&#62;
Any help?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;create_attribution&#38;quot;);

function create_attribution($form){
if($form[&#38;quot;id&#38;quot;] == &#38;#39;1&#38;#39;){
$hidden-byline = &#38;quot;Submitted by &#38;quot; . $_POST[&#38;quot;input_4&#38;quot;] . &#38;quot;, from &#38;quot;. $_POST[&#38;quot;input_5&#38;quot;] . &#38;quot;, who &#38;quot; . $_POST[&#38;quot;input_6&#38;quot;] . &#38;quot; affiliated with the site.&#38;quot;;
$_POST[&#38;quot;input_8&#38;quot;] = $hidden-byline;
}
return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
