<?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 use tip and a question</title>
		<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question</link>
		<description>Gravity Support Forums Topic: Hidden field use tip and a question</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 19:05:57 +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-use-tip-and-a-question" rel="self" type="application/rss+xml" />

		<item>
			<title>simplycm on "Hidden field use tip and a question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question#post-3729</link>
			<pubDate>Wed, 03 Mar 2010 15:55:25 +0000</pubDate>
			<dc:creator>simplycm</dc:creator>
			<guid isPermaLink="false">3729@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, I found a way to make it work. I created my hidden field and set Gravity Forms to insert {user_agent} into that field. Then I added some code to my functions.php to rewrite that field:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;pre_submission_handler&#38;quot;);
function pre_submission_handler($form_meta){
	global $_POST;
	// form id 1 is our main contact form
	if($form_meta[&#38;quot;id&#38;quot;] != &#38;#39;1&#38;#39;){
		return;
	}
	//http://useragentstring.com/index.php?uas={user_agent}
	$_POST[&#38;quot;input_7&#38;quot;] = &#38;#39;http://useragentstring.com/index.php?uas=&#38;#39; . urlencode($_POST[&#38;quot;input_7&#38;quot;]);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I wasn't quite sure how to create a field on the fly or I may have just grabbed the user agent from PHP and built the field in the script instead.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>simplycm on "Hidden field use tip and a question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question#post-3662</link>
			<pubDate>Mon, 01 Mar 2010 12:46:38 +0000</pubDate>
			<dc:creator>simplycm</dc:creator>
			<guid isPermaLink="false">3662@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't even need to retrieve data from the site. I just want to construct a URL I can click later when needed.&#60;/p&#62;
&#60;p&#62;If you can show me a sample of a hook that populates a hidden field I can probably put the rest together.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Hidden field use tip and a question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question#post-3644</link>
			<pubDate>Mon, 01 Mar 2010 00:08:01 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3644@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This could be done with something like the pre-populate hook and manually passing the user agent information using PHP and then receiving data back from useragentstrong.com and then populating the hidden field with it. It would require some knowledge of PHP to pull off.  How familiar are you with PHP?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>simplycm on "Hidden field use tip and a question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question#post-3631</link>
			<pubDate>Sat, 27 Feb 2010 23:17:31 +0000</pubDate>
			<dc:creator>simplycm</dc:creator>
			<guid isPermaLink="false">3631@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Just noticed that I left out that doing a PHP urlencode() on the user_agent field should do the trick. I'm just not quite sure how to put the pieces together.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>simplycm on "Hidden field use tip and a question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hidden-field-use-tip-and-a-question#post-3630</link>
			<pubDate>Sat, 27 Feb 2010 17:47:49 +0000</pubDate>
			<dc:creator>simplycm</dc:creator>
			<guid isPermaLink="false">3630@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I thought others might find this tip useful too. I just started using gravity forms to collect customer support requests and I often need to know the user's IP address and browser user agent string to help in troubleshooting. Those are easy enough to insert into a hidden field but I wanted to take it further to streamline some of the steps I usually take even more.&#60;/p&#62;
&#60;p&#62;So instead of just inserting {ip} in a hidden field, I put this:&#60;br /&#62;
&#60;a href=&#34;http://www.maxmind.com/app/locate_ip?ips=&#34; rel=&#34;nofollow&#34;&#62;http://www.maxmind.com/app/locate_ip?ips=&#60;/a&#62;{ip}&#60;/p&#62;
&#60;p&#62;That creates a URL I can just click to use MaxMind's geo IP lookup. So besides just the IP I can get an approximate geographical location and usually some info about their ISP.&#60;/p&#62;
&#60;p&#62;Here's the question part. I'd like to to the same thing with the user agent string and send it over to &#60;a href=&#34;http://useragentstring.com&#34; rel=&#34;nofollow&#34;&#62;http://useragentstring.com&#60;/a&#62;, which does a nice breakdown of browser features. The problem is, if I do something like this:&#60;br /&#62;
&#60;a href=&#34;http://useragentstring.com/index.php?Analyze=&#34; rel=&#34;nofollow&#34;&#62;http://useragentstring.com/index.php?Analyze=&#60;/a&#62;{user_agent}&#60;/p&#62;
&#60;p&#62;it doesn't work because there are spaces in the string. I'm assuming this could be done with a hook but I could use a pointer in the right direction. Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
