<?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: Not allowing spaces in fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields</link>
		<description>Gravity Support Forums Topic: Not allowing spaces in fields</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 19:58:16 +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/not-allowing-spaces-in-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Not allowing spaces in fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields#post-109281</link>
			<pubDate>Thu, 27 Dec 2012 20:13:34 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">109281@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;A space character is valid in a WordPress username.  You might have reasons for not allowing them, but a space character is accepted when creating a WordPress user account.&#60;/p&#62;
&#60;p&#62;However, if you want to return a validation error when a space is entered in your username field, you can check for spaces in the input like this (on line 08):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
// change input_1 here to your field ID
// \s is any whitespace character
if ( preg_match(&#38;quot;/\s/&#38;quot;, $_POST[&#38;#39;input_1&#38;#39;] )) {&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Not allowing spaces in fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields#post-109273</link>
			<pubDate>Thu, 27 Dec 2012 19:40:17 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">109273@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can't just take that code and use it. You will have to find a way to detect the space character using PHP. There are many tutorials on Google to do just that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>contractorws on "Not allowing spaces in fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields#post-109255</link>
			<pubDate>Thu, 27 Dec 2012 19:07:03 +0000</pubDate>
			<dc:creator>contractorws</dc:creator>
			<guid isPermaLink="false">109255@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I seemed to have got the code to work for the most part, however, how would I change the validation from &#34;86&#34; in the example to a space?&#60;/p&#62;
&#60;p&#62;I'm trying to use this validation on a field that will be used for a WP username, thus not allowing spaces in the username.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Not allowing spaces in fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields#post-105214</link>
			<pubDate>Thu, 20 Dec 2012 23:44:24 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">105214@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If it crashes your site, you have added it in the wrong place in the file, or you have a syntax error.  If you post your complete functions.php to pastebin.com or pastie.org we can check it for syntax errors.  Please post the complete file as it stands when it crashes your site.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>contractorws on "Not allowing spaces in fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/not-allowing-spaces-in-fields#post-105115</link>
			<pubDate>Thu, 20 Dec 2012 17:51:31 +0000</pubDate>
			<dc:creator>contractorws</dc:creator>
			<guid isPermaLink="false">105115@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I created a form and am using it with the User Registration add-on. I'd like to limit the field for username to now allow spaces. &#60;/p&#62;
&#60;p&#62;I found a tutorial on not allowing certain characters in a field: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_validation&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;When I try adding that to my &#60;code&#62;functions.php&#60;/code&#62; file, it crashed my site, until it's removed. Once that's figured out, how would I adapt the code to not allowing spaces, rather than &#34;86&#34; like in the example.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
