<?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: Minimum Word Count Custom Validation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/minimum-word-count-custom-validation</link>
		<description>Gravity Support Forums Topic: Minimum Word Count Custom Validation</description>
		<language>en-US</language>
		<pubDate>Wed, 29 Apr 2026 10:19:18 +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/minimum-word-count-custom-validation" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Minimum Word Count Custom Validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/minimum-word-count-custom-validation#post-81276</link>
			<pubDate>Mon, 15 Oct 2012 21:22:35 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">81276@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This was discussed recently here:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/minimum-number-of-characterswords&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/minimum-number-of-characterswords&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Minimum Word Count Custom Validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/minimum-word-count-custom-validation#post-81274</link>
			<pubDate>Mon, 15 Oct 2012 21:21:36 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">81274@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for posting that solution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Heck4 on "Minimum Word Count Custom Validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/minimum-word-count-custom-validation#post-81253</link>
			<pubDate>Mon, 15 Oct 2012 18:31:16 +0000</pubDate>
			<dc:creator>Heck4</dc:creator>
			<guid isPermaLink="false">81253@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I had a need to perform custom validation on a field so that at least 150 words were filled in.  I noticed on the support forums that no code example existed.  Since I figured this out, I thought I would share my code.  I added this to my functions.php file using the WordPress theme editor.  Change the name of the filter to suit your situation.&#60;/p&#62;
&#60;p&#62;Filter name:   gform_field_validation_11_70&#60;br /&#62;
11 refers to my form id&#60;br /&#62;
70 refers to the field id on my form&#60;/p&#62;
&#60;p&#62;Kind regards,&#60;br /&#62;
Casey&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Added custom validation for minimum word count
add_filter(&#38;quot;gform_field_validation_11_70&#38;quot;, &#38;quot;validate_word_count&#38;quot;, 10, 4);

function validate_word_count($result, $value, $form, $field){
    if (str_word_count($value) &#38;lt; 150) //Minimum number of words
    {
        $result[&#38;quot;is_valid&#38;quot;] = false;
        $result[&#38;quot;message&#38;quot;] = &#38;quot;Please enter at least 150 words.&#38;quot;;
    }
    return $result;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
