<?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: Maximum Word Count</title>
		<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count</link>
		<description>Gravity Support Forums Topic: Maximum Word Count</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 15:09:25 +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/maximum-word-count" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Maximum Word Count"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count#post-376180</link>
			<pubDate>Fri, 22 Aug 2014 08:09:02 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">376180@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This functionality is also available as a plugin here:&#60;/p&#62;
&#60;p&#62;GP Word Count for Gravity Forms&#60;br /&#62;
&#60;a href=&#34;http://gravitywiz.com/documentation/gp-word-count/&#34; rel=&#34;nofollow&#34;&#62;http://gravitywiz.com/documentation/gp-word-count/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>redkite on "Maximum Word Count"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count#post-149331</link>
			<pubDate>Mon, 18 Feb 2013 11:39:20 +0000</pubDate>
			<dc:creator>redkite</dc:creator>
			<guid isPermaLink="false">149331@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Another way to do it... we started with the resource in &#60;a href=&#34;http://roshanbh.com.np/2008/10/jquery-plugin-word-counter-textarea.html&#34; rel=&#34;nofollow&#34;&#62;http://roshanbh.com.np/2008/10/jquery-plugin-word-counter-textarea.html&#60;/a&#62; but wound up a little differently.&#60;/p&#62;
&#60;p&#62;Save this in /themes/yourtheme/js/ as jquery.gravity_wordcount.js:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;jQuery(document).ready(function($) {
    $(&#38;quot;[class*=&#38;#39;count[&#38;#39;]&#38;quot;).each(function() {
        var elClass = $(this).attr(&#38;#39;class&#38;#39;);
        var maxWords = 0;
        var countControl = elClass.substring((elClass.indexOf(&#38;#39;[&#38;#39;))+1, elClass.lastIndexOf(&#38;#39;]&#38;#39;)).split(&#38;#39;,&#38;#39;);

        if (countControl.length &#38;gt; 1) {
            minWords = countControl[0];
            maxWords = countControl[1];
        } else {
            maxWords = countControl[0];
        }

        $(this).find(&#38;#39;textarea&#38;#39;).bind(&#38;#39;keyup click blur focus change paste&#38;#39;, function() {
            var numWords = jQuery.trim($(this).val()).replace(/\s+/g,&#38;quot; &#38;quot;).split(&#38;#39; &#38;#39;).length;

            if ($(this).val() === &#38;#39;&#38;#39;) {
                numWords = 0;
            }

            $(this).siblings(&#38;#39;.word-count-wrapper&#38;#39;).children(&#38;#39;.word-count&#38;#39;).text(numWords);

            if (numWords &#38;gt; maxWords &#38;amp;&#38;amp; maxWords != 0) {
                $(this).siblings(&#38;#39;.word-count-wrapper&#38;#39;).addClass(&#38;#39;error&#38;#39;);

                var trimmedString = &#38;#39;&#38;#39;;
                var wordArray = $(this).val().split(/[\s\.\?]+/);
                for (var i = 0; i &#38;lt; maxWords; i++) {
                    trimmedString += wordArray[i] + &#38;#39; &#38;#39;;
                }

                $(this).val(trimmedString);
            }
            else if (numWords == maxWords &#38;amp;&#38;amp; maxWords != 0) {
                $(this).siblings(&#38;#39;.word-count-wrapper&#38;#39;).addClass(&#38;#39;error&#38;#39;);
            }
            else {
                $(this).siblings(&#38;#39;.word-count-wrapper&#38;#39;).removeClass(&#38;#39;error&#38;#39;);
            }

        }).after(&#38;#39;&#38;lt;span class=&#38;quot;word-count-wrapper&#38;quot;&#38;gt;Total Word Count: &#38;lt;span class=&#38;quot;word-count&#38;quot;&#38;gt;0&#38;lt;/span&#38;gt;&#38;lt;/span&#38;gt;&#38;#39;);
    });
});&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/* Gravity Forms Word Count Script */
function els_load_scripts() {
	wp_enqueue_script(&#38;#39;gravity-forms-word-count&#38;#39;, get_stylesheet_directory_uri() . &#38;#39;/js/jquery.gravity_word_count.js&#38;#39;, array(&#38;#39;jquery&#38;#39;), &#38;#39;0.1&#38;#39;, true);
}
add_action(&#38;#39;wp_enqueue_scripts&#38;#39;, &#38;#39;els_load_scripts&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then in the form, for fields that need the word count, add the class ‘els-word-count[300].' Change [300] as needed for the maximum words that can be added to that particular field.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hellotoby on "Maximum Word Count"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count#post-146742</link>
			<pubDate>Wed, 13 Feb 2013 19:45:30 +0000</pubDate>
			<dc:creator>hellotoby</dc:creator>
			<guid isPermaLink="false">146742@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This can be done using the reverse of this post: &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/minimum-word-count-custom-validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/minimum-word-count-custom-validation&#60;/a&#62;&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
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;/blockquote&#62;
&#60;p&#62;Here is my modified solution:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Added custom validation for minimum word count
	add_filter(&#38;quot;gform_field_validation_1_6&#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;gt; 50) // Maximum number of words
	    {
	        $result[&#38;quot;is_valid&#38;quot;] = false;
	        $result[&#38;quot;message&#38;quot;] = &#38;quot;Please enter 50 words or less.&#38;quot;;
	    }
	    return $result;
	}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Maximum Word Count"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count#post-63735</link>
			<pubDate>Wed, 27 Jun 2012 07:47:19 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">63735@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the suggestion.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rothbert on "Maximum Word Count"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/maximum-word-count#post-63715</link>
			<pubDate>Tue, 26 Jun 2012 22:41:51 +0000</pubDate>
			<dc:creator>Rothbert</dc:creator>
			<guid isPermaLink="false">63715@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;A maximum word count feature would be great. &#60;/p&#62;
&#60;p&#62;I know there is maximum character count available, but word count as an option there would be very helpful. &#60;/p&#62;
&#60;p&#62;This has been raised in pre-purchase question and this resource mentioned: &#60;a href=&#34;http://roshanbh.com.np/2008/10/jquery-plugin-word-counter-textarea.html&#34; rel=&#34;nofollow&#34;&#62;http://roshanbh.com.np/2008/10/jquery-plugin-word-counter-textarea.html&#60;/a&#62; but having looked there I have no ideas about how to implement the code and don't have the resource to justify hiring a developer who does.&#60;/p&#62;
&#60;p&#62;Add my vote for the integration of a word count feature :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
