<?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: Create a form that enters information into the usermeta table</title>
		<link>https://legacy.forums.gravityhelp.com/topic/create-a-form-that-enters-information-into-the-usermeta-table</link>
		<description>Gravity Support Forums Topic: Create a form that enters information into the usermeta table</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 06:52:44 +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/create-a-form-that-enters-information-into-the-usermeta-table" rel="self" type="application/rss+xml" />

		<item>
			<title>mkrapf on "Create a form that enters information into the usermeta table"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/create-a-form-that-enters-information-into-the-usermeta-table#post-3755</link>
			<pubDate>Thu, 04 Mar 2010 13:52:46 +0000</pubDate>
			<dc:creator>mkrapf</dc:creator>
			<guid isPermaLink="false">3755@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I would like to create a multi-step registration process.&#60;/p&#62;
&#60;p&#62;After registering the user would be redirected to the Gravity Form.  They would be asked a series of questions (eg. address).&#60;/p&#62;
&#60;p&#62;The function below can handle adding the data into the usermeta table.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php }

add_action( &#38;#39;personal_options_update&#38;#39;, &#38;#39;save_extra_user_profile_fields&#38;#39; );
add_action( &#38;#39;edit_user_profile_update&#38;#39;, &#38;#39;save_extra_user_profile_fields&#38;#39; );

function save_extra_user_profile_fields( $user_id ) {

if ( !current_user_can( &#38;#39;edit_user&#38;#39;, $user_id ) ) { return false; }

update_usermeta( $user_id, &#38;#39;address&#38;#39;, $_POST[&#38;#39;address&#38;#39;] );
update_usermeta( $user_id, &#38;#39;city&#38;#39;, $_POST[&#38;#39;city&#38;#39;] );
update_usermeta( $user_id, &#38;#39;state&#38;#39;, $_POST[&#38;#39;state&#38;#39;] );
update_usermeta( $user_id, &#38;#39;postalcode&#38;#39;, $_POST[&#38;#39;postalcode&#38;#39;] );
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;My question is: &#60;strong&#62;How can I tie this function in with the Gravity Forms pre or post submission hook to get data from the field to the usermeta table?&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;I've been successful at adding new fields to the profile page which allows the user to add/edit usermeta, but I'm not wanting to rely on the profile page because I would like to make some of the fields required.&#60;/p&#62;
&#60;p&#62;The code I used to do that is below.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_action( &#38;#39;show_user_profile&#38;#39;, &#38;#39;extra_user_profile_fields&#38;#39; );
add_action( &#38;#39;edit_user_profile&#38;#39;, &#38;#39;extra_user_profile_fields&#38;#39; );

function extra_user_profile_fields( $user ) { ?&#38;gt;
&#38;lt;h3&#38;gt;&#38;lt;?php _e(&#38;quot;Extra profile information&#38;quot;, &#38;quot;blank&#38;quot;); ?&#38;gt;&#38;lt;/h3&#38;gt;

&#38;lt;table class=&#38;quot;form-table&#38;quot;&#38;gt;
&#38;lt;tr&#38;gt;
&#38;lt;th&#38;gt;&#38;lt;label for=&#38;quot;address&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Address&#38;quot;); ?&#38;gt;&#38;lt;/label&#38;gt;&#38;lt;/th&#38;gt;
&#38;lt;td&#38;gt;
&#38;lt;input type=&#38;quot;text&#38;quot; name=&#38;quot;address&#38;quot; id=&#38;quot;address&#38;quot; value=&#38;quot;&#38;lt;?php echo esc_attr( get_the_author_meta( &#38;#39;address&#38;#39;, $user-&#38;gt;ID ) ); ?&#38;gt;&#38;quot; class=&#38;quot;regular-text&#38;quot; /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;span class=&#38;quot;description&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Please enter your address.&#38;quot;); ?&#38;gt;&#38;lt;/span&#38;gt;
&#38;lt;/td&#38;gt;
&#38;lt;/tr&#38;gt;
&#38;lt;tr&#38;gt;
&#38;lt;th&#38;gt;&#38;lt;label for=&#38;quot;city&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;City&#38;quot;); ?&#38;gt;&#38;lt;/label&#38;gt;&#38;lt;/th&#38;gt;
&#38;lt;td&#38;gt;
&#38;lt;input type=&#38;quot;text&#38;quot; name=&#38;quot;city&#38;quot; id=&#38;quot;city&#38;quot; value=&#38;quot;&#38;lt;?php echo esc_attr( get_the_author_meta( &#38;#39;city&#38;#39;, $user-&#38;gt;ID ) ); ?&#38;gt;&#38;quot; class=&#38;quot;regular-text&#38;quot; /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;span class=&#38;quot;description&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Please enter your city.&#38;quot;); ?&#38;gt;&#38;lt;/span&#38;gt;
&#38;lt;/td&#38;gt;
&#38;lt;/tr&#38;gt;
&#38;lt;tr&#38;gt;
&#38;lt;th&#38;gt;&#38;lt;label for=&#38;quot;state&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;State&#38;quot;); ?&#38;gt;&#38;lt;/label&#38;gt;&#38;lt;/th&#38;gt;
&#38;lt;td&#38;gt;
&#38;lt;input type=&#38;quot;text&#38;quot; name=&#38;quot;state&#38;quot; id=&#38;quot;state&#38;quot; value=&#38;quot;&#38;lt;?php echo esc_attr( get_the_author_meta( &#38;#39;state&#38;#39;, $user-&#38;gt;ID ) ); ?&#38;gt;&#38;quot; class=&#38;quot;regular-text&#38;quot; /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;span class=&#38;quot;description&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Please enter your state.&#38;quot;); ?&#38;gt;&#38;lt;/span&#38;gt;
&#38;lt;/td&#38;gt;
&#38;lt;/tr&#38;gt;
&#38;lt;tr&#38;gt;
&#38;lt;th&#38;gt;&#38;lt;label for=&#38;quot;postalcode&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Postal Code&#38;quot;); ?&#38;gt;&#38;lt;/label&#38;gt;&#38;lt;/th&#38;gt;
&#38;lt;td&#38;gt;
&#38;lt;input type=&#38;quot;text&#38;quot; name=&#38;quot;postalcode&#38;quot; id=&#38;quot;postalcode&#38;quot; value=&#38;quot;&#38;lt;?php echo esc_attr( get_the_author_meta( &#38;#39;postalcode&#38;#39;, $user-&#38;gt;ID ) ); ?&#38;gt;&#38;quot; class=&#38;quot;regular-text&#38;quot; /&#38;gt;&#38;lt;br /&#38;gt;
&#38;lt;span class=&#38;quot;description&#38;quot;&#38;gt;&#38;lt;?php _e(&#38;quot;Please enter your postal code.&#38;quot;); ?&#38;gt;&#38;lt;/span&#38;gt;
&#38;lt;/td&#38;gt;
&#38;lt;/tr&#38;gt;
&#38;lt;/table&#38;gt;
&#38;lt;?php }

add_action( &#38;#39;personal_options_update&#38;#39;, &#38;#39;save_extra_user_profile_fields&#38;#39; );
add_action( &#38;#39;edit_user_profile_update&#38;#39;, &#38;#39;save_extra_user_profile_fields&#38;#39; );

function save_extra_user_profile_fields( $user_id ) {

if ( !current_user_can( &#38;#39;edit_user&#38;#39;, $user_id ) ) { return false; }

update_usermeta( $user_id, &#38;#39;address&#38;#39;, $_POST[&#38;#39;address&#38;#39;] );
update_usermeta( $user_id, &#38;#39;city&#38;#39;, $_POST[&#38;#39;city&#38;#39;] );
update_usermeta( $user_id, &#38;#39;state&#38;#39;, $_POST[&#38;#39;state&#38;#39;] );
update_usermeta( $user_id, &#38;#39;postalcode&#38;#39;, $_POST[&#38;#39;postalcode&#38;#39;] );
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
