<?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: Reade form values in custom validation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation</link>
		<description>Gravity Support Forums Topic: Reade form values in custom validation</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 16:18:28 +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/reade-form-values-in-custom-validation" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Reade form values in custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation#post-22770</link>
			<pubDate>Fri, 08 Apr 2011 07:23:08 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">22770@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Gbotica,&#60;/p&#62;
&#60;p&#62;For checkbox values it would be $_POST['input_{field_id}_{choice_index}']. Given your example it would be: $_POST['input_16_1'].&#60;/p&#62;
&#60;p&#62;Also, just a handy little tip... you can use php's print_rr function to output all of the values (and their corresponding keys) like so: print_rr($_POST).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbotica on "Reade form values in custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation#post-22752</link>
			<pubDate>Thu, 07 Apr 2011 21:34:52 +0000</pubDate>
			<dc:creator>gbotica</dc:creator>
			<guid isPermaLink="false">22752@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your help.&#60;/p&#62;
&#60;p&#62;I've got it now, except can't seem to get chckbox values (I know they only pass when checked), but even so, I can't get the value.&#60;/p&#62;
&#60;p&#62;$_POST['input_16.1'], or should it be: $_POST['input_16.1'][0]
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Reade form values in custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation#post-22747</link>
			<pubDate>Thu, 07 Apr 2011 18:54:01 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">22747@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In addition, we've written a walk through for using this the gform_validation hook: &#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://bit.ly/foLW6t&#34; rel=&#34;nofollow&#34;&#62;http://bit.ly/foLW6t&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Reade form values in custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation#post-22713</link>
			<pubDate>Thu, 07 Apr 2011 14:47:00 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">22713@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Gbotica,&#60;/p&#62;
&#60;p&#62;Here is an in-depth usage of the &#60;strong&#62;gform_validation&#60;/strong&#62; hook that covers retrieving the submitted value for the field. &#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/1768573&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1768573&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The value is available in the $_POST and can be access using the following key format: &#34;input_{field_id}&#34;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbotica on "Reade form values in custom validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/reade-form-values-in-custom-validation#post-22676</link>
			<pubDate>Thu, 07 Apr 2011 02:56:01 +0000</pubDate>
			<dc:creator>gbotica</dc:creator>
			<guid isPermaLink="false">22676@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;hi, I'm referring to this custom validation sample:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation&#38;#39;, &#38;#39;custom_validation&#38;#39;);
function custom_validation($validation_result){

    // set the form validation to false
    $validation_result[&#38;quot;is_valid&#38;quot;] = false;
    $form = $validation_result[&#38;quot;form&#38;quot;];

    // specify the first field to be invalid and provide custom validation message
    $form[&#38;quot;fields&#38;quot;][0][&#38;quot;failed_validation&#38;quot;] = true;
    $form[&#38;quot;fields&#38;quot;][0][&#38;quot;validation_message&#38;quot;] = &#38;quot;This field is invalid!&#38;quot;;

    // update the form in the validation result with the form object you modified
    $validation_result[&#38;quot;form&#38;quot;] = $form;

    return $validation_result;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;How do I access the fields actual value to validate it?&#60;/p&#62;
&#60;p&#62;$form[&#34;fields&#34;][0][&#34;value&#34;] doesn't seem to work?&#60;/p&#62;
&#60;p&#62;where in the docs do I find the list of possibilities for this $form[&#34;fields&#34;] array?&#60;/p&#62;
&#60;p&#62;thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
