<?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: Form displays calculation results</title>
		<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results</link>
		<description>Gravity Support Forums Topic: Form displays calculation results</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Apr 2026 13:14:14 +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/form-displays-calculation-results" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33769</link>
			<pubDate>Mon, 29 Aug 2011 08:56:55 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">33769@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;rgpost() is a &#34;safe&#34; way to retrieve values from the $_POST global. It automatically checks to see if the requested index/key exists in the $_POST global before attempting to access that index/key to prevent undefined index notices.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>x2gravity on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33768</link>
			<pubDate>Mon, 29 Aug 2011 08:37:17 +0000</pubDate>
			<dc:creator>x2gravity</dc:creator>
			<guid isPermaLink="false">33768@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Worked perfectly&#60;br /&#62;
Thanks&#60;/p&#62;
&#60;p&#62;Can you tell me what rgpost does?&#60;br /&#62;
Thanks again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33761</link>
			<pubDate>Mon, 29 Aug 2011 07:28:41 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">33761@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi x2gravity,&#60;/p&#62;
&#60;p&#62;Give this a shot:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/2447989&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2447989&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The issue was you were updating the $_POST after Gravity Forms has already processed the entry and retrieved all the values from the $_POST. By using the gform_pre_submission hook, we can add the $savings value to the &#34;Savings&#34; field $_POST before Gravity Forms processes the entry so the new value will be processed.&#60;/p&#62;
&#60;p&#62;You can access the saved value using the token; something like {Field Name:field_id} ~ {Savings:2}. You can get the actual token from the drop down on the confirmation message and add it anywhere in the message.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>x2gravity on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33753</link>
			<pubDate>Mon, 29 Aug 2011 05:36:31 +0000</pubDate>
			<dc:creator>x2gravity</dc:creator>
			<guid isPermaLink="false">33753@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;At the moment no value is returned. Thanks for the heads up regarding the use of &#34;post_submission&#34;. What do you recommend I use?&#60;/p&#62;
&#60;p&#62;Yes I just want to use the number that the user submits, do some simple calculations based on that number and return the result to the user via the displayed confirmation message. I might not even save in the database as well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33692</link>
			<pubDate>Sat, 27 Aug 2011 13:54:31 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">33692@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;What happens now when this runs?  Does any value come back or is it always -100 or something?&#60;/p&#62;
&#60;p&#62;Also, I think you are going to run into problems because you are running this &#34;post_submission&#34; which is after the entry is created.  So, you will not be able to insert this into input_2 since the entry is already created.&#60;/p&#62;
&#60;p&#62;Are you just trying to take a number they submit, and show them a savings of 100 in the confirmation text (not an email, just the displayed confirmation message)?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>x2gravity on "Form displays calculation results"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-displays-calculation-results#post-33631</link>
			<pubDate>Fri, 26 Aug 2011 08:12:16 +0000</pubDate>
			<dc:creator>x2gravity</dc:creator>
			<guid isPermaLink="false">33631@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have tried to use this example (&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/mathematics-to-gravity-forms&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/mathematics-to-gravity-forms&#60;/a&#62;) and create a form that basically does a small calculation but cannot get it to work.&#60;/p&#62;
&#60;p&#62;Here is my code&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_action(&#38;quot;gform_post_submission_8&#38;quot;, &#38;quot;calculate_savings&#38;quot;, 10, 2);
function calculate_savings($entry, $form){
	$savings = $entry[&#38;#39;1&#38;#39;] - 100;

	$_POST[&#38;#39;input_2&#38;#39;] = $savings;

        return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;POST['input_2'] is a hidden field in the form which I then insert in the confirmation message for the user to see.&#60;/p&#62;
&#60;p&#62;$entry['1'] is basically a numeric field which I then use to calculate.&#60;/p&#62;
&#60;p&#62;Any help would be appreciated&#60;br /&#62;
Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
