<?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: Change hidden field value based on custom validation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/change-hidden-field-value-based-on-custom-validation</link>
		<description>Gravity Support Forums Topic: Change hidden field value based on custom validation</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:38:04 +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/change-hidden-field-value-based-on-custom-validation" rel="self" type="application/rss+xml" />

		<item>
			<title>passatgt on "Change hidden field value based on custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/change-hidden-field-value-based-on-custom-validation#post-230755</link>
			<pubDate>Tue, 30 Apr 2013 05:10:35 +0000</pubDate>
			<dc:creator>passatgt</dc:creator>
			<guid isPermaLink="false">230755@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I created a custom validation method for a field with the gform_validation filter.&#60;br /&#62;
Is it possible to store some data in a hidden field inside the gform_validation filter?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation&#38;#39;, &#38;#39;media_custom_validation&#38;#39;);

function media_custom_validation($validation_result) {

 	global $form_email, $file_id;

	// new gravity form
	$rg = new RGFormsModel(); 

 	// grab the form
        $form = $validation_result[&#38;quot;form&#38;quot;];

 	// only validate the vault form
  	if ($form[&#38;#39;title&#38;#39;] == &#38;quot;Item Support&#38;quot;) {

		foreach($form[&#38;#39;fields&#38;#39;] as &#38;amp;$field) {

			// store email field in variable
			if ($field[&#38;#39;id&#38;#39;] == &#38;quot;5&#38;quot;) {
						if(true){
							//success, store data in one of the hidden fields
						} else {

							//error
						}
				}

			}

		}
	}
    return $validation_result;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
