<?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 using PHP class</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class</link>
		<description>Gravity Support Forums Topic: gform_validation using PHP class</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 00:44:09 +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-using-php-class" rel="self" type="application/rss+xml" />

		<item>
			<title>burfield on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-125340</link>
			<pubDate>Fri, 18 Jan 2013 11:58:00 +0000</pubDate>
			<dc:creator>burfield</dc:creator>
			<guid isPermaLink="false">125340@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex - many thanks. I've sent you the code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-124447</link>
			<pubDate>Thu, 17 Jan 2013 12:06:32 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">124447@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Your code looks right and the filter should fire. The only question is where you are placing it. The $this variable is only defined inside your class, so you need to make sure that line of code is being called inside one of your class' methods.&#60;br /&#62;
I will be glad to take a look at your file if you send it to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62; (please include a link to this post)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>burfield on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-124381</link>
			<pubDate>Thu, 17 Jan 2013 10:11:58 +0000</pubDate>
			<dc:creator>burfield</dc:creator>
			<guid isPermaLink="false">124381@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In addition it's worth mentioning that the only reason I was trying to apply custom validation is because the dropdown field I marked as &#34;required&#34; in the GF admin area was not being picked up as invalid during form submission.&#60;/p&#62;
&#60;p&#62;The process was:&#60;/p&#62;
&#60;p&#62;1) Form is rendered and dropdown A is populated with values form a Custom Post Type.&#60;br /&#62;
2) When the user selects from dropdown A, some javascript runs which populates dropdown B with the correct values (these are from another post type).&#60;br /&#62;
3) When the form is submitted with the default value (eg: &#34;Please select&#34;) Gravity forms allows the form to be submitted even though it should fail validation due to no value being selected.&#60;/p&#62;
&#60;p&#62;I've now resolved the issue which lies in the GF's admin interface for Form creation. The issue was that by default even though I'd removed all but 1 value for the dropdown B, GF's was setting a &#34;value&#34; attribute on the option element. This caused it to pass validation as there was always value selected. &#60;/p&#62;
&#60;p&#62;To solve this, in the form builder admin area you must select &#34;Show values&#34; on the &#34;Choices&#34; field and then ensure that the contents of the &#34;Value&#34; field is entirely blank. I feel this should be made more obvious.&#60;/p&#62;
&#60;p&#62;So in essence my issue is solved in the short term. Nonetheless I would appreciate feedback from your developers on how I might be able to add_filter using a Class method.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>burfield on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-124367</link>
			<pubDate>Thu, 17 Jan 2013 09:42:51 +0000</pubDate>
			<dc:creator>burfield</dc:creator>
			<guid isPermaLink="false">124367@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Great stuff. Happy to send website code to a private email but not able to post on forum.&#60;/p&#62;
&#60;p&#62;If it helps the &#60;code&#62;gform_pre_render_7&#60;/code&#62; filter seems to work perfectly using the same method:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_filter(&#38;#39;gform_pre_render_7&#38;#39;, array( $this, &#38;#39;populate_select_fields&#38;#39; ) );&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The &#60;code&#62;apply_filters&#60;/code&#62; call in form_display.php seems quite complex. Maybe this is where is issue lies...? Maybe it's my code?&#60;/p&#62;
&#60;p&#62;Help is appreciated.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-124313</link>
			<pubDate>Thu, 17 Jan 2013 08:09:47 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">124313@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll bring this to the attention of the development team for their input.  I've never seen anyone try to use gform_validation like this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>burfield on "gform_validation using PHP class"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_validation-using-php-class#post-124296</link>
			<pubDate>Thu, 17 Jan 2013 07:54:32 +0000</pubDate>
			<dc:creator>burfield</dc:creator>
			<guid isPermaLink="false">124296@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;My form has ID &#34;7&#34;. I'm trying to fire a custom validation on submit but the validation function doesn't appear to be running.&#60;/p&#62;
&#60;p&#62;I believe this might be to do with the fact that I'm working with a PHP Class which means I'm doing the following&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation_7&#38;#39;, array( $this, &#38;#39;validate_me&#38;#39; ) );&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;rather than simply...&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation_7&#38;#39;, &#38;#39;validate_me&#38;#39;  );&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The validate me method does not get called when I submit my form. I know this because I've placed&#60;/p&#62;
&#60;p&#62;&#60;code&#62;exit()&#60;/code&#62; &#60;/p&#62;
&#60;p&#62;within the body of that method. No dice.&#60;/p&#62;
&#60;p&#62;Any help much appreciated.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
