<?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: use radio buttons to pre-populate a hidden field</title>
		<link>https://legacy.forums.gravityhelp.com/topic/use-radio-buttons-to-pre-populate-a-hidden-field</link>
		<description>Gravity Support Forums Topic: use radio buttons to pre-populate a hidden field</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:49: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/use-radio-buttons-to-pre-populate-a-hidden-field" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "use radio buttons to pre-populate a hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-radio-buttons-to-pre-populate-a-hidden-field#post-48934</link>
			<pubDate>Thu, 09 Feb 2012 18:36:33 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">48934@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You would need to do this using the gform_pre_submission hook so that it happens after the form is submitted but before the entry is created and notifications are sent.&#60;/p&#62;
&#60;p&#62;You would use the gform_pre_submission hook and write custom code to 1) read the values of your radio buttons 2) perform whatever calculation you want to perform and 3) populate the hidden field on your form with whatever you want the value to be based on 1 &#38;amp; 2.&#60;/p&#62;
&#60;p&#62;The gform_pre_submission hook is documented here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It has access to the form object which contains all of the submitted form data.  &#60;/p&#62;
&#60;p&#62;The documentation has an example that shows how to populate the value of a field using the gform_pre_submission hook, although your use case is a little more complex (although still nothing big) as you want to first perform a calculation, etc.  You would use standard PHP to do this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>radeleeuw on "use radio buttons to pre-populate a hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-radio-buttons-to-pre-populate-a-hidden-field#post-48905</link>
			<pubDate>Thu, 09 Feb 2012 17:36:02 +0000</pubDate>
			<dc:creator>radeleeuw</dc:creator>
			<guid isPermaLink="false">48905@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;dear sir/madam,&#60;br /&#62;
my compliments for the best wordpress plugin ever!&#60;/p&#62;
&#60;p&#62;I want to dynamically populate a hidden field, or admin only field called &#34;output&#34;.&#60;br /&#62;
To do this I want to use 2 questions using radio buttons.&#60;br /&#62;
Question 1 has 2 answers: &#34;yes&#34; (I gave it a value &#34;4&#34;), and &#34;no&#34; (value 2).&#60;br /&#62;
Question 2 has 3 answers: &#34;yes&#34; (value 4), &#34;sometimes&#34; (value 3) and &#34;no&#34; (value 2).&#60;/p&#62;
&#60;p&#62;I want to use the sum of the values of question 1 and 2 and populate the dynamic field &#34;output&#34; like this:&#60;br /&#62;
if question 1 + question 2 = 8  =&#38;gt; &#34;everything&#34;&#60;br /&#62;
if question 1 + question 2 = 7  =&#38;gt; &#34;almost everything&#34;&#60;br /&#62;
if question 1 + question 2 = 6  =&#38;gt; &#34;sometimes&#34;&#60;br /&#62;
if question 1 + question 2 = 5  =&#38;gt; &#34;sure thing&#34;&#60;br /&#62;
if question 1 + question 2 = 4  =&#38;gt; &#34;no&#34;&#60;/p&#62;
&#60;p&#62;I tried to do this using a hook, but I can't figure it out.&#60;/p&#62;
&#60;p&#62;Can someone help me with this?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
