<?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 field that supports validation by regular expressions</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions</link>
		<description>Gravity Support Forums Topic: Custom field that supports validation by regular expressions</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 01:25:40 +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-field-that-supports-validation-by-regular-expressions" rel="self" type="application/rss+xml" />

		<item>
			<title>Anonymous on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-31166</link>
			<pubDate>Thu, 28 Jul 2011 19:56:22 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">31166@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Alex, I have a similar question/issue. My client wants us to validate the email field to ensure it's not coming from any free email hosts (they want commercial entities only). Here's their original code snippet for this validation... my question is how do I incorporate this into GF?&#60;/p&#62;
&#60;p&#62;Validation code snippet can be found here:&#60;br /&#62;
&#60;a href=&#34;http://dl.dropbox.com/u/19790225/email_form_validation.php&#34; rel=&#34;nofollow&#34;&#62;http://dl.dropbox.com/u/19790225/email_form_validation.php&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Sean
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-12652</link>
			<pubDate>Sat, 13 Nov 2010 17:31:40 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">12652@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Following is a sample code snippet. To get the submitted field value, you can use $_POST[&#34;input_XXX&#34;]&#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;</description>
		</item>
		<item>
			<title>kevinmcgillivray on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-12645</link>
			<pubDate>Sat, 13 Nov 2010 13:21:39 +0000</pubDate>
			<dc:creator>kevinmcgillivray</dc:creator>
			<guid isPermaLink="false">12645@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, Alex.  Should I email you to get that snippet of code you mentioned?&#60;/p&#62;
&#60;p&#62;Thanks!&#60;br /&#62;
kcm
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kevinmcgillivray on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-12512</link>
			<pubDate>Thu, 11 Nov 2010 13:56:22 +0000</pubDate>
			<dc:creator>kevinmcgillivray</dc:creator>
			<guid isPermaLink="false">12512@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, Alex.  Yes, that would be great.  Please send me the code snippet.&#60;/p&#62;
&#60;p&#62;Thanks!  &#60;/p&#62;
&#60;p&#62;kcm
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-12510</link>
			<pubDate>Thu, 11 Nov 2010 13:53:53 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">12510@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That is a good idea, but meanwhile you can add your own custom validation using a hook and a few lines of PHP. If that is something you want to try, I can send you a code snippet.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kevinmcgillivray on "Custom field that supports validation by regular expressions"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-field-that-supports-validation-by-regular-expressions#post-12504</link>
			<pubDate>Thu, 11 Nov 2010 13:41:47 +0000</pubDate>
			<dc:creator>kevinmcgillivray</dc:creator>
			<guid isPermaLink="false">12504@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there.  I'd love to have a field type called &#34;Custom&#34; that allows me to specific my own regular expression for field validation.  Seems like it would be a pretty simple thing to add on but I'm just guessing.&#60;/p&#62;
&#60;p&#62;Gravity Forms rocks!&#60;/p&#62;
&#60;p&#62;Thanks!&#60;br /&#62;
kcm
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
