<?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: tags field character limiter,</title>
		<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter</link>
		<description>Gravity Support Forums Topic: tags field character limiter,</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 05:19:23 +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/tags-field-character-limiter" rel="self" type="application/rss+xml" />

		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67828</link>
			<pubDate>Wed, 25 Jul 2012 03:16:32 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67828@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;title_length&#38;#39;);
function title_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_1&#38;#39;]) &#38;gt; 100){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;1&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;Your title is too long 100 characters Google max&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;tags_length&#38;#39;);
function tags_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_8&#38;#39;]) &#38;gt; 100){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;8&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;&#38;lt;strong&#38;gt;100 words and spaces.&#38;lt;/strong&#38;gt; Please only use a handful of pinpointed keywords. You do not need many, just pick the ones that are pinpoint. For example: If your title is ( &#38;lt;em&#38;gt;Tile floor cleaning&#38;lt;/em&#38;gt; ) do not used keywords like ( &#38;lt;em&#38;gt;carpet cleaning&#38;lt;/em&#38;gt; ) You will &#38;lt;strong&#38;gt;confuse the search engines.&#38;lt;/strong&#38;gt; Post separate ads for each service or item your offering. See ( &#38;lt;em&#38;gt;Things to know before you post&#38;lt;/em&#38;gt; ) here to the right in yellow for more info.&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;email_length&#38;#39;);
function email_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_11&#38;#39;]) &#38;gt; 50){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;11&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;&#38;lt;strong&#38;gt;50 word and spaces max.&#38;lt;/strong&#38;gt;.&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;companies_length&#38;#39;);
function companies_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_17&#38;#39;]) &#38;gt; 50){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;17&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;&#38;lt;strong&#38;gt;50 word and spaces max.&#38;lt;/strong&#38;gt;.&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;contact_name_length&#38;#39;);
function contact_name_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_18&#38;#39;]) &#38;gt; 50){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;18&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;&#38;lt;strong&#38;gt;50 word and spaces max.&#38;lt;/strong&#38;gt;.&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;web_address_length&#38;#39;);
function web_address_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_19&#38;#39;]) &#38;gt; 50){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;19&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;&#38;lt;strong&#38;gt;50 word and spaces max.&#38;lt;/strong&#38;gt;.&#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks dave and Chris! again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67691</link>
			<pubDate>Tue, 24 Jul 2012 08:25:59 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67691@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, what David said.  That fatal error is because you can't declare a function more than one time.  The function needs to be renamed:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
function title_length&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;When you copy the function code, rename the function.  You're using this a lot, so you are going to have to rename it multiple times:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;tags_length
email_length
companies_length
contact_name_length
web_address_length&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You need to change the &#60;strong&#62;function&#60;/strong&#62; line, and also in the &#60;strong&#62;add_filter&#60;/strong&#62; line where the function is called.&#60;/p&#62;
&#60;p&#62;HOWEVER, this is a hugely inefficient way to do things.  Use the same function (title_length), but maybe rename it to something like &#34;input_length_limiter&#34;, then in the function, process all the fields, and return the form one time.  It will be easier for maintenance going forward and will run substantially faster.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67684</link>
			<pubDate>Tue, 24 Jul 2012 08:06:12 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">67684@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;What it is telling you is that you already have a function called title_length, and can't &#34;change&#34; it. You can either add code to your original function to detect other fields, so doing some more if statements to test for various fields or rename the function so you don't have two attempts to run the same function to do different things.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67660</link>
			<pubDate>Mon, 23 Jul 2012 23:32:32 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67660@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;the page if you refreshed had an error on the 1st line of the duplicated script&#60;br /&#62;
Fatal error: Cannot redeclare title_length() (previously declared in /home/adszoom/public_html/wp-content/themes/adszoom/functions.php:68) in /home/adszoom/public_html/wp-content/themes/adszoom/functions.php on line 124&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;#39;gform_validation_2&#38;#39;, &#38;#39;title_length&#38;#39;);
function title_length($validation_result){
	$form = $validation_result[&#38;quot;form&#38;quot;];

    //supposing we don&#38;#39;t want input_1 to be longer than 100 characters.
    if(strlen($_POST[&#38;#39;input_8&#38;#39;]) &#38;gt; 100){

        // set the form validation to false
        $validation_result[&#38;quot;is_valid&#38;quot;] = false;

        //finding Field with ID of 1 and marking it as failed validation
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){

            //NOTE: replace 1 with the field you would like to validate
            if($field[&#38;quot;id&#38;quot;] == &#38;quot;8&#38;quot;){
                $field[&#38;quot;failed_validation&#38;quot;] = true;
                $field[&#38;quot;validation_message&#38;quot;] = &#38;quot;test for tages &#38;quot;;
                break;
            }
        }

    }

    //Assign modified $form object back to the validation result
    $validation_result[&#38;quot;form&#38;quot;] = $form;
    return $validation_result;

}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67657</link>
			<pubDate>Mon, 23 Jul 2012 23:27:30 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67657@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi &#60;/p&#62;
&#60;p&#62;Sorry Chris ya the hole site went down no syntax errors
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67625</link>
			<pubDate>Mon, 23 Jul 2012 20:16:43 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67625@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;
I have tried to copy and past the code in the functions. php under the current snip above replacing the title fields,,, no good.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;What do you mean, &#34;no good&#34;?  What was the result?  Was there a syntax error about not being able to redeclare the function name or something?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67613</link>
			<pubDate>Mon, 23 Jul 2012 19:34:17 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67613@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;so to clarify i just need the other fields limited like the title.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67612</link>
			<pubDate>Mon, 23 Jul 2012 19:32:22 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67612@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;what i did so far&#60;/p&#62;
&#60;p&#62;I have tried to copy and past the code in the functions. php under the current snip above replacing the title fields,,, no good. also wp codax but most of the solutions only work if the poster uses the default wp admin to post
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67611</link>
			<pubDate>Mon, 23 Jul 2012 19:28:37 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">67611@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hay Chris thanks for the reply ya that dose solve the issue on the preview page we made but take a look at this &#60;a href=&#34;http://www.adszoom.com/category/art/&#34; rel=&#34;nofollow&#34;&#62;http://www.adszoom.com/category/art/&#60;/a&#62; see the tags... out of control! so i figured if i can stop it at the time of the post like i did the title, that by the way had the same issue with people putting in 1000's of words... ugly / just bad . If i can do the same we are good to go. This then will reflect what we need it to, on the preview instead of hiding the extra.. but grate idea. &#60;/p&#62;
&#60;p&#62;by the way i have bin going round and round on this other issue that you looked at,, any ideas ?&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/changing-the-background-color-of-a-post&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/changing-the-background-color-of-a-post&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "tags field character limiter,"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/tags-field-character-limiter#post-67610</link>
			<pubDate>Mon, 23 Jul 2012 19:16:19 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67610@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm not sure I understand the question.  You would like to apply this same functionality (100 characters max) to those other fields you listed, in addition to the post title, and you would like help with doing that? &#60;/p&#62;
&#60;p&#62;Instead of that, how about hiding the overflow for those various fields, in the post, with:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[css]
overflow: hidden;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;After setting a width on the element?  It would not return an error but it would prevent the corruption of your site's layout.&#60;/p&#62;
&#60;p&#62;Please clarify what you would like help with and what you have tried so far.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
