<p>Somewhere, I came across a thread that Brad had provided a bit of insight about the First &amp; Last name fields. They are kind of "special" is all I can remember.</p>

<p>In any event, the First &amp; Last name fields do not need the <code>fields</code> prepended to them. They can get passed along like this:</p>

<pre><code>&lt;input type="text" id="firstName" name="firstName" class="form-control" 
{%- if account is defined %} value="{{ account.firstName }}"{% endif %}"&gt;
{{ account is defined and account ? errorList(account.getErrors('firstName')) }}

...

&lt;input type="text" id="lastName" name="lastName" class="form-control" 
{%- if account is defined %} value="{{ account.lastName }}"{% endif %}"&gt;
{{ account is defined and account ? errorList(account.getErrors('lastName')) }}
</code></pre>

<p>As for not getting added to your group, have you created a user group for newly registered users? For example, let's say I created a user group called "Public". Then (assuming you are using Craft Pro) Craft will give me the option to choose which user group I want the default user group to be. Are you able to set that?</p>

CC BY-SA 3.0
2016-01-04T09:57:44.803Z
Thanks Damon, The first name and last name now function properly after updating the name attribute to the input. With regards to the user not getting added to the default group 'Registered User' - yes I have Craft Pro, yes the group has been selected as the default group that new users will be added to, but no they are not being added to it. FYI the group is empty currently. Thanks
Adam Menczykowski
CC BY-SA 3.0
2016-01-04T16:01:27.707Z
Can anybody chime in as to perhaps why the new user is not getting added to the default group?
Adam Menczykowski
CC BY-SA 3.0
2016-01-06T15:36:25.107Z
Update: Disabling 'Verify email addresses?' doesn't alter the behaviour other than the user is created and activated simultaneously. Unfortunately, the user is still not added to the default user group.
Adam Menczykowski
CC BY-SA 3.0
2016-01-07T14:23:12.337Z
Probably silly comment, but do you have "allow guest registration" checked? Very strange that the users aren't getting added. When you visit that CP screen, does the drop down reflect the default user group?
Damon
CC BY-SA 3.0
2016-01-07T15:08:56.540Z
If you mean 'Allow public registration?' - yes that is checked. And yes the dropdown reflects the default user group 'Registered Users'
Adam Menczykowski
CC BY-SA 3.0
2016-01-07T17:20:36.153Z
I wonder if Sprout Forms is affecting this native Registration Form?
Adam Menczykowski
CC BY-SA 3.0
2016-01-07T17:56:44.423Z
That is possible - in my (limited) user registration experience I've never had a problem getting users to show. I'd hit up the guys at Sprout to see if they have noticed anything like this before.
Damon
CC BY-SA 3.0
2016-01-11T14:02:08.860Z
The user is getting added, but not added to the default group, even after confirmation email link has been clicked. I'll speak to the Sprout guys to see if they've heard of anything like this before. Thanks
Adam Menczykowski
CC BY-SA 4.0
2019-09-01T01:10:41.280Z
Same answer here.  Has this been resolved?
biko
CC BY-SA 4.0
2019-09-01T01:27:14.023Z
UPDATE: it seems to work actually.  Cases where this doesn't work seems to be if you're already logged in Craft (as an admin in my case).
biko
CC BY-SA 3.0
2015-12-23T15:56:28.540Z
2015-12-23T15:56:28.540Z
Damon
<p><strong>Answer to the confirmation email and group issue.</strong></p>

<p>I was have the exact same issue but it seems that it was because I was already logged into Craft (as an admin in my case).  So try it in a private window or be sure to not be logged in.</p>

CC BY-SA 4.0
2019-09-01T01:28:38.240Z
2019-09-01T01:28:38.240Z
biko
<p>I have been testing out my user registration form and get to the following point:</p>

<p><strong>1. User is created</strong> </p>

<p>Most of the profile is created, except the firstName and lastName (these are the handles that I am using in the form) are not created.</p>

<p><strong>2. User is not added to default group</strong></p>

<p>Here is my form markup:</p>

<pre><code>&lt;form method="post" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}

    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value="{{ url('/?status=registrationEmailSent') }}"&gt;

    {% macro errorList(errors) %}
        {% if errors %}
            &lt;ul class="errors"&gt;
                {% for error in errors %}
                    &lt;li&gt;{{ error }}&lt;/li&gt;
                {% endfor %}
            &lt;/ul&gt;
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    &lt;h3&gt;Required fields:&lt;/h3&gt;

    &lt;h4&gt;&lt;label for="firstName"&gt;First Name&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="firstName" name="fields[firstName]" 
        {%- if account is defined %} value="{{ account.firstName }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('firstName')) }}

    &lt;h4&gt;&lt;label for="lastName"&gt;Surname&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="lastName" name="fields[lastName]" 
        {%- if account is defined %} value="{{ account.lastName }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('lastName')) }}

    &lt;h4&gt;&lt;label for="username"&gt;Username&lt;/label&gt;&lt;/h4&gt;
    &lt;input id="username" type="text" name="username"
        {%- if account is defined %} value="{{ account.username }}"{% endif -%}&gt;

    {% if account is defined %}
        {{ errorList(account.getErrors('username')) }}
    {% endif %}

    &lt;h4&gt;&lt;label for="email"&gt;Email&lt;/label&gt;&lt;/h4&gt;
    &lt;input id="email" type="text" name="email"
        {%- if account is defined %} value="{{ account.email }}"{% endif %}&gt;

    {% if account is defined %}
        {{ errorList(account.getErrors('email')) }}
    {% endif %}

    &lt;h4&gt;&lt;label for="password"&gt;Password&lt;/label&gt;&lt;/h4&gt;
    &lt;input id="password" type="password" name="password"&gt;

    {% if account is defined %}
        {{ errorList(account.getErrors('password')) }}
    {% endif %}

    &lt;h3&gt;Optional fields:&lt;/h3&gt;
    &lt;p class="instructions"&gt;We would appreciate it if you could please provide just a little bit more info about your company.&lt;/p&gt;
    &lt;h4&gt;&lt;label for="membersCompanyName"&gt;Company Name&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="membersCompanyName" name="fields[membersCompanyName]" 
        {%- if account is defined %} value="{{ account.membersCompanyName }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('membersCompanyName')) }}

    &lt;h4&gt;&lt;label for="membersPosition"&gt;Job Title&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="membersPosition" name="fields[membersPosition]" 
        {%- if account is defined %} value="{{ account.membersPosition }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('membersPosition')) }}

    &lt;h4&gt;&lt;label for="membersPhoneNumber"&gt;Telephone no.&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="membersPhoneNumber" name="fields[membersPhoneNumber]" 
        {%- if account is defined %} value="{{ account.membersPhoneNumber }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('membersPhoneNumber')) }}

    &lt;h4&gt;&lt;label for="membersWebsite"&gt;Website&lt;/label&gt;&lt;/h4&gt;
    &lt;input type="text" id="membersWebsite" name="fields[membersWebsite]" 
        {%- if account is defined %} value="{{ account.membersWebsite }}"{% endif %}&gt;
    {{ account is defined and account ? errorList(account.getErrors('membersWebsite')) }}

    &lt;input type="submit" value="Register"&gt;
    &lt;p&gt;&lt;a href="{{ url('members/login') }}"&gt;No, I just want to log in.&lt;/a&gt;&lt;/p&gt;
&lt;/form&gt;
</code></pre>

<p>Any help would be greatly appreciated.</p>

CC BY-SA 3.0
2016-05-10T15:16:32.007Z
Have exactly same problem where user is not being added to a group on registration in the front-end. did you work out a solution to this problem?
Cole Henley
<registration><user-groups><craft-pro>
User registration - no confirmation email sent, not added to group
# User registration - no confirmation email sent, not added to group

(Asked by: username_0 on 2015-12-23)

I have been testing out my user registration form and get to the following point:
1. User is created 
Most of the profile is created, except the firstName and lastName (these are the handles that I am using in the form) are not created.
2. User is not added to default group
Here is my form markup:

    {{ getCsrfInput() }}

    
    

    {% macro errorList(errors) %}
        {% if errors %}
            
                {% for error in errors %}
                    {{ error }}
                {% endfor %}
            
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    Required fields:

    First Name
    
    {{ account is defined and account ? errorList(account.getErrors('firstName')) }}

    Surname
    
    {{ account is defined and account ? errorList(account.getErrors('lastName')) }}

    Username
    

    {% if account is defined %}
        {{ errorList(account.getErrors('username')) }}
    {% endif %}

    Email
    

    {% if account is defined %}
        {{ errorList(account.getErrors('email')) }}
    {% endif %}

    Password
    

    {% if account is defined %}
        {{ errorList(account.getErrors('password')) }}
    {% endif %}

    Optional fields:
    We would appreciate it if you could please provide just a little bit more info about your company.
    Company Name
    
    {{ account is defined and account ? errorList(account.getErrors('membersCompanyName')) }}

    Job Title
    
    {{ account is defined and account ? errorList(account.getErrors('membersPosition')) }}

    Telephone no.
    
    {{ account is defined and account ? errorList(account.getErrors('membersPhoneNumber')) }}

    Website
    
    {{ account is defined and account ? errorList(account.getErrors('membersWebsite')) }}

    
    No, I just want to log in.


Any help would be greatly appreciated.

**Tags:** registration, user-groups, craft-pro
> **Comments:**
> **username_1**: Have exactly same problem where user is not being added to a group on registration in the front-end. did you work out a solution to this problem?  

---

## 2 answers

### Answer by username_2 on 2015-12-23. Score: 1 | Accepted answer

Somewhere, I came across a thread that Brad had provided a bit of insight about the First & Last name fields. They are kind of "special" is all I can remember.
In any event, the First & Last name fields do not need the fields prepended to them. They can get passed along like this:

{{ account is defined and account ? errorList(account.getErrors('firstName')) }}

...


{{ account is defined and account ? errorList(account.getErrors('lastName')) }}

As for not getting added to your group, have you created a user group for newly registered users? For example, let's say I created a user group called "Public". Then (assuming you are using Craft Pro) Craft will give me the option to choose which user group I want the default user group to be. Are you able to set that?

> **Comments:**
> **username_0**: Thanks Damon, The first name and last name now function properly after updating the name attribute to the input. With regards to the user not getting added to the default group 'Registered User' - yes I have Craft Pro, yes the group has been selected as the default group that new users will be added to, but no they are not being added to it. FYI the group is empty currently. Thanks  
> **username_0**: Can anybody chime in as to perhaps why the new user is not getting added to the default group?  
> **username_0**: Update: Disabling 'Verify email addresses?' doesn't alter the behaviour other than the user is created and activated simultaneously. Unfortunately, the user is still not added to the default user group.  
> **username_2**: Probably silly comment, but do you have "allow guest registration" checked? Very strange that the users aren't getting added. When you visit that CP screen, does the drop down reflect the default user group?  
> **username_0**: If you mean 'Allow public registration?' - yes that is checked. And yes the dropdown reflects the default user group 'Registered Users'  
> **username_0**: I wonder if Sprout Forms is affecting this native Registration Form?  
> **username_2**: That is possible - in my (limited) user registration experience I've never had a problem getting users to show. I'd hit up the guys at Sprout to see if they have noticed anything like this before.  
> **username_0**: The user is getting added, but not added to the default group, even after confirmation email link has been clicked. I'll speak to the Sprout guys to see if they've heard of anything like this before. Thanks  
> **username_3**: Same answer here.  Has this been resolved?  
> **username_3**: UPDATE: it seems to work actually.  Cases where this doesn't work seems to be if you're already logged in Craft (as an admin in my case).  

---

### Answer by username_3 on 2019-09-01. Score: 0

**Answer to the confirmation email and group issue.**

I was have the exact same issue but it seems that it was because I was already logged into Craft (as an admin in my case). So try it in a private window or be sure to not be logged in.


---

