<?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: gform_validation--total price field capped at certain $</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-total-price-field-capped-at-certain</link>
		<description>Gravity Support Forums Topic: gform_validation--total price field capped at certain $</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 01:25: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/gform_validation-total-price-field-capped-at-certain" rel="self" type="application/rss+xml" />

		<item>
			<title>littler.chicken on "gform_validation--total price field capped at certain $"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-total-price-field-capped-at-certain#post-258155</link>
			<pubDate>Fri, 17 May 2013 15:17:05 +0000</pubDate>
			<dc:creator>littler.chicken</dc:creator>
			<guid isPermaLink="false">258155@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I hope this is possible with gform_validation but I've never used this and really don't know how to approach it. Have looked at the docs and am not making progress.&#60;/p&#62;
&#60;p&#62;What I have is a form which has two &#34;products&#34; on it--one is $7, one is $2. Theoretically unlimited products can be purchased but the maximum amount that can be charged is $25. So, if someone puts in 4 adults (the $7 product), the total price should be $25, not $28. Can I set up the gform validation to change the total price, and therefore charge that, instead of throwing an error message?&#60;/p&#62;
&#60;p&#62;Here is what I've muddled myself into at this point using the documentation and some forum searching, but it's not working:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;/** Gravity Forms Validation */
add_filter(&#38;quot;gform_validation_4&#38;quot;, &#38;quot;rgc_totalvalidation&#38;quot;);
function rgc_totalvalidation($validation_result){
    $form = $validation_result[&#38;quot;form&#38;quot;];
	if($_POST[&#38;#39;ginput_total_4&#38;#39;] &#38;gt;= 25 ){
		if($is_valid)
            continue;
		$validation_result[&#38;quot;is_valid&#38;quot;] = false;
		foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
			if($field[&#38;quot;id&#38;quot;] == &#38;quot;input_4_4&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;value&#38;quot;] = &#38;quot;25&#38;quot;;
                break;
			}
		}
	}
	//Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The form in question is &#60;a href=&#34;http://smpc.robincornett.com/event/family-night/&#34; rel=&#34;nofollow&#34;&#62;here&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
