<?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: Custom Validation affects all Gravity Forms on the Site</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site</link>
		<description>Gravity Support Forums Topic: Custom Validation affects all Gravity Forms on the Site</description>
		<language>en-US</language>
		<pubDate>Fri, 24 Apr 2026 22:01:35 +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/custom-validation-affects-all-gravity-forms-on-the-site" rel="self" type="application/rss+xml" />

		<item>
			<title>growthspark on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-22089</link>
			<pubDate>Wed, 30 Mar 2011 15:23:49 +0000</pubDate>
			<dc:creator>growthspark</dc:creator>
			<guid isPermaLink="false">22089@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://pastie.org/1736358&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1736358&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Looks like that worked!&#60;br /&#62;
I pasted my function above and where I added the != so others could see the resolution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21990</link>
			<pubDate>Tue, 29 Mar 2011 16:13:26 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">21990@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Growth,&#60;/p&#62;
&#60;p&#62;Sorry for the confusion. Apparently the &#60;strong&#62;gform_validation&#60;/strong&#62; was one of the few hooks that did not have the ID specific version. We've added this to the core for the next release.&#60;/p&#62;
&#60;p&#62;In the meantime, you can do a simple conditional at the very beginning of the function that checks for the form ID and then returns the result if the submission is coming from a different form ID. Here is an example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
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
$form = $validation_result[&#38;quot;form&#38;quot;];

if($form[&#38;#39;id&#38;#39;] != 1)
    return $validation_result;

... rest of your code ...&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>growthspark on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21987</link>
			<pubDate>Tue, 29 Mar 2011 15:53:29 +0000</pubDate>
			<dc:creator>growthspark</dc:creator>
			<guid isPermaLink="false">21987@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Wanted to see if there was anything found in the function I submitted or if you need me to try anything specific.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21866</link>
			<pubDate>Mon, 28 Mar 2011 18:08:11 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">21866@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll have a developer look at your code, the filter should work so it's probably something in the code itself.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>growthspark on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21865</link>
			<pubDate>Mon, 28 Mar 2011 18:00:33 +0000</pubDate>
			<dc:creator>growthspark</dc:creator>
			<guid isPermaLink="false">21865@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hm... the reason I asked the question in that way, however, was that I had tried that per another post in the forum to which I think you had responded.&#60;br /&#62;
When I add that, it disables the custom validation completely.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/1728462&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1728462&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;So there the _1 is appended and it is as if the forms no longer see the filter.&#60;br /&#62;
I have confirmed that I am indeed working with form ID 1.&#60;/p&#62;
&#60;p&#62;I'm running GF1.5, WP3.1, PHP 5.2.10	, MySQL 5.0.81.&#60;/p&#62;
&#60;p&#62;Is there another way to confine it to Form ID 1?  Aside from that, the custom validation works well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21864</link>
			<pubDate>Mon, 28 Mar 2011 17:53:15 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">21864@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Change This:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation&#38;#39;, &#38;#39;custom_validation&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;To This:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation_1&#38;#39;, &#38;#39;custom_validation&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;You append the form id to the end of the gform_validation filter call. &#60;/p&#62;
&#60;p&#62;The documentation has been updated to reflect this.  Most of the hook/filter calls work the same way and it is reflected in the documentation.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>growthspark on "Custom Validation affects all Gravity Forms on the Site"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-validation-affects-all-gravity-forms-on-the-site#post-21862</link>
			<pubDate>Mon, 28 Mar 2011 17:51:13 +0000</pubDate>
			<dc:creator>growthspark</dc:creator>
			<guid isPermaLink="false">21862@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://pastie.org/1728462&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1728462&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Above is the Custom Validation code for a VIN validation form I created.&#60;br /&#62;
Works perfectly except that it tries to apply the validation against all Gravity Forms, is there a way to wrap the function or tag it such that it only affects form ID 1 and no other form?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
