<?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: Pre-Render Names into Form</title>
		<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form</link>
		<description>Gravity Support Forums Topic: Pre-Render Names into Form</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 03:02:46 +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/pre-render-names-into-form" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Pre-Render Names into Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form#post-67198</link>
			<pubDate>Fri, 20 Jul 2012 06:37:09 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67198@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There were a couple problems with your code in &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/pre-render-names-into-form#post-66941&#34; rel=&#34;nofollow&#34;&#62;this comment&#60;/a&#62; but that is a moot point now.    It's sometimes easier to get the values from simple, separate form fields as you've done.  I'm happy to hear you worked it out.  Thanks for the update.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Noel Green on "Pre-Render Names into Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form#post-66942</link>
			<pubDate>Wed, 18 Jul 2012 17:09:09 +0000</pubDate>
			<dc:creator>Noel Green</dc:creator>
			<guid isPermaLink="false">66942@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Never mind... I just did it another way.&#60;/p&#62;
&#60;p&#62;I created two single text fields, used a merge tag of {user:first_name} and {user:last_name} to insert the names... then did an &#34;after submission function to update the username based on those fields like so...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function gf_profile_update( $entry, $form )
{
	global $current_user;
	get_currentuserinfo();

	$first_name = $entry[&#38;#39;45&#38;#39;];
	$last_name = $entry[&#38;#39;46&#38;#39;];

	update_user_meta( $current_user-&#38;gt;ID, &#38;#39;first_name&#38;#39;, $first_name );
	update_user_meta( $current_user-&#38;gt;ID, &#38;#39;last_name&#38;#39;, $last_name );
}

add_action( &#38;#39;gform_after_submission_2&#38;#39;, &#38;#39;gf_profile_update&#38;#39;, 10, 2 );&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Noel Green on "Pre-Render Names into Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form#post-66941</link>
			<pubDate>Wed, 18 Jul 2012 16:58:28 +0000</pubDate>
			<dc:creator>Noel Green</dc:creator>
			<guid isPermaLink="false">66941@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Nope... no luck yet.&#60;/p&#62;
&#60;p&#62;This is what I have now. It's exporting the first name to the title of the entire form set (so it says, &#34;Name (Noel)&#34;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field) {
	if(rgar($field, &#38;quot;inputs&#38;quot;)) {
		foreach($field[&#38;quot;inputs&#38;quot;] as $input){
			if ($field[&#38;quot;id&#38;quot;] == 1) {
				$field[&#38;quot;inputs&#38;quot;][3][&#38;quot;label&#38;quot;] = $first_name;
			}
			if ($field[&#38;quot;id&#38;quot;] == 1) {
				$field[&#38;quot;inputs&#38;quot;][6][&#38;quot;label&#38;quot;] = $last_name;
			}
		}
	}
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Pre-Render Names into Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form#post-66919</link>
			<pubDate>Wed, 18 Jul 2012 14:45:05 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">66919@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The name input is a complex field and as such will have inputs.  Please dump the $form array and take a look.  Additionally, this is documented here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Check the second (final) example on that page, specifically where it talks about &#34;complex field&#34; and &#34;inputs.&#34;  I think you'll get it after that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Noel Green on "Pre-Render Names into Form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-names-into-form#post-66895</link>
			<pubDate>Wed, 18 Jul 2012 14:00:47 +0000</pubDate>
			<dc:creator>Noel Green</dc:creator>
			<guid isPermaLink="false">66895@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So I have a form that people register with where they enter their first and last name.  Then I have a separate form that they can edit once they're logged in that has different / more data.  But it also includes their first and last name field.  I need to populate that field with the user's first and last name and (for reasons I'm not going to go into here... just trust me... ) can't use the normal conventions to do so.&#60;/p&#62;
&#60;p&#62;Therefore I have this code... which works for another field but I can't get it to work on the first and last name field.  I'm thinking one of the parameters is defined wrong, but I can't figure out which one.  Help?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//Display User Name #
//form # = the &#38;quot;Personal Profile&#38;quot; form (2)
add_filter(&#38;quot;gform_pre_render_2&#38;quot;, &#38;quot;personal_info&#38;quot;);
function personal_info($form) {

    if($form[&#38;quot;id&#38;quot;] != 2)
       return $form;

	global $post;
	global $current_user;

	$first_name =  $current_user-&#38;gt;first_name;
	$last_name = $current_user-&#38;gt;last_name;

	foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field) {
		if ($field[&#38;quot;id&#38;quot;] == 1.3) {
			$field[&#38;quot;defaultValue&#38;quot;] =  $first_name;
		}
		if ($field[&#38;quot;id&#38;quot;] == 1.6) {
			$field[&#38;quot;defaultValue&#38;quot;] =  $last_name;
		}
	}
	return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The $first_name is grabbing the name.  btw.&#60;br /&#62;
I can test it with a hardcoded string and it still won't work.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
