<?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: Creating hidden fields with static values ...</title>
		<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values</link>
		<description>Gravity Support Forums Topic: Creating hidden fields with static values ...</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 02:33:49 +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/creating-hidden-fields-with-static-values" rel="self" type="application/rss+xml" />

		<item>
			<title>randomwalk on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20385</link>
			<pubDate>Thu, 10 Mar 2011 20:24:21 +0000</pubDate>
			<dc:creator>randomwalk</dc:creator>
			<guid isPermaLink="false">20385@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, just made progress.  Started thinking about the properties as a cohesive whole, so a property set in javascript is the same as a property set in php, as they translate directly.  Now I've got a whole lot more I can tweak with the custom fields.  Sweetness!  Thanks again!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>randomwalk on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20381</link>
			<pubDate>Thu, 10 Mar 2011 19:50:40 +0000</pubDate>
			<dc:creator>randomwalk</dc:creator>
			<guid isPermaLink="false">20381@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Rightio.  One potential discrepancy I've found is that it seems the HTML elements that get shoved in a form seem to get set&#60;br /&#62;
&#60;code&#62;field.inputType = &#38;#39;html&#38;#39;;&#60;/code&#62;&#60;br /&#62;
whereas all other field types get set&#60;br /&#62;
&#60;code&#62;field.type = &#38;quot;select&#38;quot;;&#60;/code&#62;&#60;br /&#62;
or the like.  Is this syntax intended to merge at some point in the future?  I'd hate to code to one set of data, only to have the back-end plugin of GravityForms pull the carpet out from underneath me after an upgrade!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20377</link>
			<pubDate>Thu, 10 Mar 2011 19:15:31 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20377@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There is no documentation for the field object itself.  The only documentation we provide is for exposed API hooks/filters.  We don't document every piece of core code for users because they are supposed to interact with the plugin via customizations using API hooks/filters designed to be used by end users.&#60;/p&#62;
&#60;p&#62;There will be documentation for all the available hooks/filters in the new web site that will launch with the final release of 1.5 which will be launching very soon.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>randomwalk on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20374</link>
			<pubDate>Thu, 10 Mar 2011 18:55:15 +0000</pubDate>
			<dc:creator>randomwalk</dc:creator>
			<guid isPermaLink="false">20374@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yeah, that's the problem.  I've added some filters/hooks to 1.5 to let me add new custom field types and the like (and started another thread asking for some to be rolled into to the source) ... but I can't seem to sort out exactly how to finagle this.&#60;/p&#62;
&#60;p&#62;Is there some documentation explaining exactly what properties the field object (in JS, that gets sacked back and forth from php) can have, how to set them, and what they mean?&#60;/p&#62;
&#60;p&#62;Also -- one thing to tidy up the JS a bit -- you can do the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;jQuery(document).ready(function($){
    $(&#38;#39;div#blah&#38;#39;).whatever();
});&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;-- as a shortcut to use $ in noconflict mode ... just pass $ to the function.  I saw in  the JS you were using the long-hand version for all of it, and it can get a bit messy to parse through.&#60;/p&#62;
&#60;p&#62;Cheers!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20213</link>
			<pubDate>Wed, 09 Mar 2011 13:34:07 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20213@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;From the editor itself? I don't think there is a hook for the default value in the form editor.  &#60;/p&#62;
&#60;p&#62;The problem is you need some identifier to know which field to target and pre-populate.&#60;/p&#62;
&#60;p&#62;In Gravity Forms v1.5 there are some new hooks that will make this possible taking another route, but the field would still have to be added to the form.  You could use hooks/filters to create your own custom field type that incorporates your default value, etc.  But the field would still have to be added to the form in the form editor, it wouldn't automatically be added.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>randomwalk on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20185</link>
			<pubDate>Tue, 08 Mar 2011 19:52:04 +0000</pubDate>
			<dc:creator>randomwalk</dc:creator>
			<guid isPermaLink="false">20185@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Well ... kinda maybe, I guess.  Best as I can figure with that method, I'd have to store the value in the meta of the post that contains the form, then do something like ...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_myfield&#38;quot;, &#38;quot;populate_myfield&#38;quot;);
function populate_myfield($value){
return get_post_meta($GLOBALS[&#38;#39;post&#38;#39;]-&#38;gt;ID, &#38;#39;myfield&#38;#39;, true);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;like you said, but ... there's no way to pre-populate them as a static value from the form editing page?  Because with that method, it's case will depend on where the form is placed.  We want it to be static on a form-by-form basis, regardless of where that form is placed.&#60;/p&#62;
&#60;p&#62;Make sense?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20183</link>
			<pubDate>Tue, 08 Mar 2011 19:30:31 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20183@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here is a post that discusses how to populate a field (hidden or otherwise) dynamically using PHP:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/using-custom-fields-to-populate-hidden-fields#post-17616&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/using-custom-fields-to-populate-hidden-fields#post-17616&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>randomwalk on "Creating hidden fields with static values ..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/creating-hidden-fields-with-static-values#post-20182</link>
			<pubDate>Tue, 08 Mar 2011 19:26:39 +0000</pubDate>
			<dc:creator>randomwalk</dc:creator>
			<guid isPermaLink="false">20182@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hiya,&#60;/p&#62;
&#60;p&#62;We're looking to create hidden fields in forms with static values ... just for internal tracking more than anything else, and to make some coding easier to do.&#60;/p&#62;
&#60;p&#62;Now, I see in js.php, in the SetDefaultValues() JS function, switch() statement, the 'hidden' field goes something like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;case &#38;quot;hidden&#38;quot; :
            field.inputs = null;
            if(!field.label)
                field.label = &#38;quot;&#38;lt;?php _e(&#38;quot;Hidden Field&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;&#38;quot;;
            break;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'm making an additional entry in the switch JS there, and trying to find a way to set the value of the hidden field while creating it.  field.value and field.content do not work for this purpose, is there another attribute that would?  Alternatively, is there another method that I could call this via javascript?  I'm outputting my JS following the contents of js.php via the 'gform_editor_js' action hook.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
