<?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: Strip line-breaks during submission?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission</link>
		<description>Gravity Support Forums Topic: Strip line-breaks during submission?</description>
		<language>en-US</language>
		<pubDate>Mon, 06 Apr 2026 00:05:55 +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/strip-line-breaks-during-submission" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Strip line-breaks during submission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission#post-67061</link>
			<pubDate>Thu, 19 Jul 2012 13:42:17 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">67061@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, it would go in your functions.php file. And you might want to put a space in the second area for your preg_replace. Also, what is the question mark in your carriage return and new line call?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thirdriver on "Strip line-breaks during submission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission#post-67058</link>
			<pubDate>Thu, 19 Jul 2012 13:32:03 +0000</pubDate>
			<dc:creator>thirdriver</dc:creator>
			<guid isPermaLink="false">67058@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So do I past the code in functions.php?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;strip_linebreaks&#38;quot;);
function strip_linebreaks($form){
	$_POST[&#38;quot;input_11&#38;quot;] = preg_replace(&#38;quot;/\r?\n/&#38;quot;, &#38;quot;&#38;quot;, ($_POST[&#38;quot;input_11&#38;quot;]);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>thirdriver on "Strip line-breaks during submission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission#post-67047</link>
			<pubDate>Thu, 19 Jul 2012 12:57:03 +0000</pubDate>
			<dc:creator>thirdriver</dc:creator>
			<guid isPermaLink="false">67047@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I know it's not &#34;ideal&#34; - but for this application it's really not an issue passing it as a query string. The only real issue is the line breaks! Thanks for the script though - I'll let you know how it turns out
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Strip line-breaks during submission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission#post-67046</link>
			<pubDate>Thu, 19 Jul 2012 12:53:11 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">67046@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there, I don't know that you should be passing a paragraph of text through a query string as there are potential issues with that, and the string, despite reformatting won't ever get those line breaks back. You could try using the gform_pre_submission hook to strip them out using something like the script found here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://php.net/manual/en/function.str-replace.php&#34; rel=&#34;nofollow&#34;&#62;http://php.net/manual/en/function.str-replace.php&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I think they might be hiding as /r and /r/n in the text that is submitted, but I'm not certain. Instead of replacing them with html line breaks, you would want to replace them just with a space or something.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thirdriver on "Strip line-breaks during submission?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/strip-line-breaks-during-submission#post-67044</link>
			<pubDate>Thu, 19 Jul 2012 12:44:01 +0000</pubDate>
			<dc:creator>thirdriver</dc:creator>
			<guid isPermaLink="false">67044@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there a way to strip line breaks from a field before I use the data submitted?&#60;/p&#62;
&#60;p&#62;We've got a basic form - but it has to pass alot of information as a query string, and there is a paragraph area that often people type &#34;enter/enter&#34; to get two line breaks. Is there a function I can use to REMOVE those during submission?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
