<?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: limiting the title of a post characters</title>
		<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters</link>
		<description>Gravity Support Forums Topic: limiting the title of a post characters</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 02:44:27 +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/limiting-the-title-of-a-post-characters" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62706</link>
			<pubDate>Fri, 15 Jun 2012 14:17:50 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">62706@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So the issue was that the way we were handling arrays in the example was causing issues with the latest versions of Gravity Forms, but we've updated our documentation. :) You could force breaks in titles, but that wouldn't be a validation thing, also, it would require some more complex PHP code.&#60;/p&#62;
&#60;p&#62;And the validation doesn't change the data, so it probably wasn't working before either. WordPress determines where to break things up if people do extended words like that, not Gravity Forms, but again, you could create a PHP script that added a space after 50 characters under certain circumstances, or make it have a line break, but that's beyond what I could do here for Gravity Forms support.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62702</link>
			<pubDate>Fri, 15 Jun 2012 13:32:21 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62702@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;By The way Dave you the man!!!! ;)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62701</link>
			<pubDate>Fri, 15 Jun 2012 13:30:00 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62701@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;yes!!!!!!!!!!!!!!!!!!! it works thank god! is it posible thou to make the title brake say after 50 characters ?&#60;br /&#62;
( using 100 characters total )&#60;br /&#62;
if someone dose this wrbgwrbtwrtbwrtbwrtbwrtbwrtbwrbtwrbtwrbtwrtbwrtb or word-word-word- ecs it extends threw the side of the theme but if there was a brake in there there would not be an issue.. it did brake before the validation i believe. &#60;/p&#62;
&#60;p&#62;ps what was the fix for the 1 st issue so i know?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62700</link>
			<pubDate>Fri, 15 Jun 2012 12:51:28 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">62700@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Change the validation like the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_validation_3&#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&#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 "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62697</link>
			<pubDate>Fri, 15 Jun 2012 12:27:46 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62697@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;ok thanks my email is acting up so lets just use this tread
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62682</link>
			<pubDate>Fri, 15 Jun 2012 11:14:28 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62682@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;cool here is the code from the child theme  functions.php just in case&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;quot;gform_pre_render_4&#38;quot;, &#38;quot;populate_html&#38;quot;);
function populate_html($form)
{
	//this is a 2-page form with the data from page one being displayed in an html field on page 2
	$current_page = GFFormDisplay::get_current_page($form[&#38;quot;id&#38;quot;]);
	$html_content = &#38;quot;&#38;lt;strong&#38;gt;The Following Will Be Submitted To Google, Yahoo &#38;amp; Bing. Please Make Sure All Information Is Correct If You See An Error, Please Click Previous At The Bottom Of Page.&#38;lt;br&#38;gt;&#38;lt;br&#38;gt;&#38;lt;br&#38;gt;&#38;lt;br&#38;gt;We Will Index This Ad ASAP Getting This Ad Viewed By Millions. Please Make Sure The Keywords Are Correct (Watch Video) &#38;lt;br&#38;gt; We Guarantee Page 1 Of All 3 Top Search Engines For Your Ad If You Follow The Easy Instructions. ( Videos )&#38;lt;br&#38;gt;&#38;lt;br&#38;gt;Note: The Images Are Actual Size But Will Be Resized Automatically For Your Convenance.&#38;lt;/strong&#38;gt;&#38;lt;br/&#38;gt;&#38;lt;ul&#38;gt;&#38;quot;;
	if ($current_page == 2)
	{
		foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
		{
			//gather form data to save into html field (id 3 on my form), exclude page break
			if ($field[&#38;quot;id&#38;quot;] != 15 &#38;amp;&#38;amp; $field[&#38;quot;type&#38;quot;] != &#38;quot;page&#38;quot;)
			{
				//see if this is a complex field (will have inputs)
				if(rgar($field, &#38;quot;inputs&#38;quot;))
				{
					//this is a complex fieldset (name, adress, etc.) - get individual field info
					foreach($field[&#38;quot;inputs&#38;quot;] as $input){
						//get name of individual field, replace period with underscore when pulling from post
						$input_name = &#38;quot;input_&#38;quot; . str_replace(&#38;quot;.&#38;quot;,&#38;quot;_&#38;quot;,$input[&#38;quot;id&#38;quot;]);
						$value = rgpost($input_name);
						$html_content .= &#38;quot;&#38;lt;li&#38;gt;&#38;quot; . $input[&#38;quot;label&#38;quot;] . &#38;quot;: &#38;quot; . $value . &#38;quot;&#38;lt;/li&#38;gt;&#38;quot;;
					}
				}
				else
				{
					//this can be changed to be a switch statement if you need to handle each field type differently
					//get the filename of file uploaded or post image uploaded
					if ($field[&#38;quot;type&#38;quot;] == &#38;quot;fileupload&#38;quot; &#124;&#124; $field[&#38;quot;type&#38;quot;] == &#38;quot;post_image&#38;quot;)
					{
						$input_name = &#38;quot;input_&#38;quot; . $field[&#38;quot;id&#38;quot;];
						//before final submission, the image is stored in a temporary directory
						//if displaying image in the html, point the img tag to the temporary location
						$temp_filename = RGFormsModel::get_temp_filename($form[&#38;quot;id&#38;quot;], $input_name);
						$uploaded_name = $temp_filename[&#38;quot;uploaded_filename&#38;quot;];
						$temp_location = RGFormsModel::get_upload_url($form[&#38;quot;id&#38;quot;]) . &#38;quot;/tmp/&#38;quot; . $temp_filename[&#38;quot;temp_filename&#38;quot;];
						if (!empty($uploaded_name)) {
							$html_content .= &#38;quot;&#38;lt;li&#38;gt;&#38;quot; . $field[&#38;quot;label&#38;quot;] . &#38;quot;: &#38;quot; . $uploaded_name . &#38;quot;&#38;lt;img src=&#38;#39;&#38;quot; . $temp_location . &#38;quot;&#38;#39; height=&#38;#39;150&#38;#39; width=&#38;#39;150&#38;#39;&#38;gt;&#38;lt;/img&#38;gt;&#38;lt;/li&#38;gt;&#38;quot;;
						}
					}
					else
					{
						//get the label and then get the posted data for the field (this works for simple fields only - not the field groups like name and address)
						$html_content .= &#38;quot;&#38;lt;li&#38;gt;&#38;quot; . $field[&#38;quot;label&#38;quot;] . &#38;quot;: &#38;quot; . rgpost(&#38;#39;input_&#38;#39; . $field[&#38;#39;id&#38;#39;]) . &#38;quot;&#38;lt;/li&#38;gt;&#38;quot;;
					}
				}
			}
		}
		$html_content .= &#38;quot;&#38;lt;/ul&#38;gt;&#38;quot;;
		//loop back through form fields to get html field (id 3 on my form) that we are populating with the data gathered above
		foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
		{
			//get html field
			if ($field[&#38;quot;id&#38;quot;] == 15)
			{
				//set the field content to the html
				$field[&#38;quot;content&#38;quot;] = $html_content;
			}
		}
	}
	//return altered form so changes are displayed
	return $form;
}
?&#38;gt;
&#38;lt;?php
add_filter(&#38;#39;gform_validation&#38;#39;, &#38;#39;title_length&#38;#39;);
function title_length($validation_result){

    //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($validation_result[&#38;quot;form&#38;quot;][&#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&#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>David Peralty on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62680</link>
			<pubDate>Fri, 15 Jun 2012 11:11:34 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">62680@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Scott, I have the development team helping me with this now. We will let you know asap what is going on.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62679</link>
			<pubDate>Fri, 15 Jun 2012 11:11:18 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62679@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;question this form was imported from the current live site. Maybe this is the issue? i dont wanna change anything incase your working on it,
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62674</link>
			<pubDate>Fri, 15 Jun 2012 10:44:26 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62674@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;i also deactivated all plug ins and tested with same issue
&#60;/p&#62;</description>
		</item>
		<item>
			<title>scott@adszoom.com on "limiting the title of a post characters"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/limiting-the-title-of-a-post-characters#post-62672</link>
			<pubDate>Fri, 15 Jun 2012 10:36:42 +0000</pubDate>
			<dc:creator>scott@adszoom.com</dc:creator>
			<guid isPermaLink="false">62672@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi &#60;/p&#62;
&#60;p&#62;So sorry i did not see the mail anyway i took out all of the code from the child them function.php. The only code there is the gf preview and the snip from you above. I then tested the form and the form works with no preview and no title limits.&#60;br /&#62;
I then activated the 2011 theme went to functions.php and pasted in your snip tested and had the same issue, i could not get the 2nd page to load at all using the code in 2011. &#60;/p&#62;
&#60;p&#62;I then un installed 2011 thinking somehow its corrupt ?? and reinstalled a fresh copy repeated the steps and had the same affect.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
