<?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: Upon update 1.5 you cannot use the email field to populate the username field!</title>
		<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field</link>
		<description>Gravity Support Forums Topic: Upon update 1.5 you cannot use the email field to populate the username field!</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 10:12:12 +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/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field" rel="self" type="application/rss+xml" />

		<item>
			<title>chobson on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-366766</link>
			<pubDate>Sun, 07 Jul 2013 17:53:56 +0000</pubDate>
			<dc:creator>chobson</dc:creator>
			<guid isPermaLink="false">366766@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome! Thanks, that worked nicely.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>benhamil on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-359333</link>
			<pubDate>Wed, 03 Jul 2013 05:38:59 +0000</pubDate>
			<dc:creator>benhamil</dc:creator>
			<guid isPermaLink="false">359333@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have modified ABT's code above, and made a few improvements:&#60;/p&#62;
&#60;ol&#62;
&#60;li&#62; It looks for the email field by GF type, instead of label.&#60;/li&#62;
&#60;li&#62; When it finds the type, it verifies that it is a proper email address.&#60;/li&#62;
&#60;li&#62; It verifies that the email matches the confirmation value.&#60;/li&#62;
&#60;li&#62; It verifies that the &#34;username&#34; (re: email) is not already registered.&#60;/li&#62;
&#60;/ol&#62;
&#60;p&#62;It seems that my validation message for #4 isn't being displayed (GF is overriding it with &#34;Username is already registered&#34;), but it serves my purpose, so I haven't investigated why.&#60;/p&#62;
&#60;p&#62;The setup of my form in GF is as follows:&#60;/p&#62;
&#60;ul&#62;
&#60;li&#62; no username field&#60;/li&#62;
&#60;li&#62; email address field with &#60;u&#62;confirmation&#60;/u&#62; enabled&#60;/li&#62;
&#60;li&#62; user registration: create user maps both username + email address to the email form field&#60;/li&#62;
&#60;/ul&#62;
&#60;p&#62;I hope anyone who stumbles upon this finds it useful. I imagine that a LOT of people are trying to do this. GF should really add a solution to the documentation!&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// allow user to register with email address by stripping validation errors on
// the email address, so we need to verify that it meets the following conditions:
// 1. Proper email address
// 2. Email address matches confirmation value
// 3. Email address is not already registered
add_filter( &#38;#39;gform_user_registration_validation&#38;#39;, &#38;#39;custom_filter_registration&#38;#39;, 10, 3 );
function custom_filter_registration( $form, $config, $pagenum )
{
	foreach( $form[&#38;#39;fields&#38;#39;] as $k =&#38;gt; $field )
	{
		if( strtolower($field[&#38;#39;type&#38;#39;]) == &#38;#39;email&#38;#39; )
		{
			// get email address + confirmation value
			$id = $field[&#38;#39;id&#38;#39;];
			$email_1 = strtolower($_POST[&#38;#39;input_&#38;#39; . $id]);
			$email_2 = strtolower($_POST[&#38;#39;input_&#38;#39; . $id . &#38;#39;_2&#38;#39;]);
			// verify: proper email, and email matches confirmation
			if( is_valid_email($email_1) &#38;amp;&#38;amp; $email_1 == $email_2 )
			{
				// verify: email is not already used
				if( !function_exists(&#38;#39;username_exists&#38;#39;) )
					require_once(ABSPATH . WPINC . &#38;quot;/registration.php&#38;quot;);
				if( username_exists($email_1) )
				{
					$field[&#38;#39;failed_validation&#38;#39;] = true;
					$field[&#38;#39;validation_message&#38;#39;] = &#38;#39;The email &#38;#39; . $email_1 . &#38;#39; is already registered.&#38;#39;;
				} else {
					// OK: remove validation errors
					$field[&#38;#39;failed_validation&#38;#39;] = false;
					$field[&#38;#39;validation_message&#38;#39;] = &#38;#39;&#38;#39;;
					$form[&#38;#39;fields&#38;#39;][ $k ] = $field;
				}
			}
		}
	}
	return $form;
}

function is_valid_email($email) {
	return preg_match(&#38;quot;/^[_a-z0-9-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i&#38;quot;, $email);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>ABT on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-246441</link>
			<pubDate>Fri, 10 May 2013 12:03:42 +0000</pubDate>
			<dc:creator>ABT</dc:creator>
			<guid isPermaLink="false">246441@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I also have been facing this issue.  I was able to implement the workaround with the following:&#60;/p&#62;
&#60;p&#62;add_filter( 'gform_user_registration_validation', 'custom_filter_registration', 10, 3 );&#60;br /&#62;
function custom_filter_registration( $form, $config, $pagenum ) {&#60;br /&#62;
    foreach( $form['fields'] as $k =&#38;gt; $field ) {&#60;br /&#62;
        if( $field['label'] == 'Email' ) {&#60;br /&#62;
            $field['failed_validation'] = false;&#60;br /&#62;
            $field['validation_message'] = '';&#60;br /&#62;
            $form['fields'][ $k ] = $field;&#60;br /&#62;
       }&#60;/p&#62;
&#60;p&#62;    return $form;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;This is simple and naive, but it works and the validation can be extended later.  The issue is now, however, that the First Name and Last Name fields are not being saved in the user account (they are being saved in the form entry, however).  Can anyone shed any light as to why this is?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>theshae on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-218252</link>
			<pubDate>Mon, 22 Apr 2013 00:45:08 +0000</pubDate>
			<dc:creator>theshae</dc:creator>
			<guid isPermaLink="false">218252@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Josh, did you get this working? I also liked that feature. I am not sure how to implement the workaround.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-202801</link>
			<pubDate>Tue, 09 Apr 2013 15:10:00 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">202801@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You are correct about changes in 1.5.  There were changes made with this version to use the WordPress validation, which explains why you can no longer use the email address as the username. To get around this, you can use the gform_user_registration_validation hook &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_user_registration_validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_user_registration_validation&#60;/a&#62; and do your own validation on the field and/or update the existing validation of the field in the form object to be successful.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-202651</link>
			<pubDate>Tue, 09 Apr 2013 12:12:01 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">202651@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll ask the development team about this one for you.  I believe there is a way to bypass that username validation but I can't recall the method right now.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Josh on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-202453</link>
			<pubDate>Tue, 09 Apr 2013 08:34:14 +0000</pubDate>
			<dc:creator>Josh</dc:creator>
			<guid isPermaLink="false">202453@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris.&#60;/p&#62;
&#60;p&#62;Thats does make sense. However I am just using the User registration add-on 1.4. No other plugins.&#60;/p&#62;
&#60;p&#62;With these settings... &#60;a href=&#34;http://i.imgur.com/UcuEIWq.png&#34; rel=&#34;nofollow&#34;&#62;http://i.imgur.com/UcuEIWq.png&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I have been using this method on my clients project for the last two years, and have never been prompted with the standard wordpress enforcement: Only lowercase letters (a-z) and numbers are allowed.&#60;/p&#62;
&#60;p&#62;Only upon updating to User registration add-on 1.5, I am now getting issues with validation.&#60;/p&#62;
&#60;p&#62;Have you got a filter or some way of by passing this validation in 1.5? I am now having to use 1.4 again just to get by&#60;/p&#62;
&#60;p&#62;Many Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-201647</link>
			<pubDate>Mon, 08 Apr 2013 21:33:12 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">201647@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The username restrictions come from WordPress: we just enforce them.  According to WordPress, the username can only contain alphanumeric characters (A-Z, 0-9), underscores and dashes.  (spaces are also allowed but that is not mentioned.)&#60;/p&#62;
&#60;p&#62;How were you allowing the email address to be used as a username previously?  Was that from a plugin?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Josh on "Upon update 1.5 you cannot use the email field to populate the username field!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/upon-update-15-you-cannot-use-the-email-field-to-populate-the-username-field#post-201495</link>
			<pubDate>Mon, 08 Apr 2013 17:36:14 +0000</pubDate>
			<dc:creator>Josh</dc:creator>
			<guid isPermaLink="false">201495@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I have been using the User Registration add-on from some time, since 1.2 I think.&#60;/p&#62;
&#60;p&#62;I have always been updating it on my project and since now I have had no problems. As it is so good.&#60;/p&#62;
&#60;p&#62;However my Wordpress network multisite install uses the email address form field to populate both the username and email fields in the User Registration Add-On.&#60;/p&#62;
&#60;p&#62;Since updating to 1.5 I now cannot validate forms because my email form field is prompted by this message: Only lowercase letters (a-z) and numbers are allowed.&#60;/p&#62;
&#60;p&#62;I cannot revert to using non-email usernames as my client wishes it to be this way.&#60;/p&#62;
&#60;p&#62;I checked your changelog.txt file to see if you purposely done this and I cannot see any notes of this change, and am now stuck what to do. Can't seem to find anyone online with the same problem.&#60;/p&#62;
&#60;p&#62;I have reverted back to 1.4 but after checking out your changelog in 1.5, I would really like to be using 1.5.&#60;/p&#62;
&#60;p&#62;Can you help?&#60;/p&#62;
&#60;p&#62;Many thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
