<p>Realized my issue, I was sending back the option labels instead of the option values for the dropdown fields in the form.</p>

CC BY-SA 3.0
2017-11-06T20:43:59.930Z
2017-11-06T20:43:59.930Z
bgrnwd
<p>I'm having some trouble saving custom user fields via a front-end form as described <a href="https://craftcms.com/docs/templating/user-profile-form" rel="nofollow noreferrer">here</a>. All the other forms on the site that use the same method save the data correctly. I'm able to pull in the user data correctly if I manually input it in the Craft dashboard. I examined the POST request from the form in devtools and I get a 200 status code so it seems like it's posting the data correctly, however it doesn't seem to be saving on Craft's side.</p>

<p>Any help would be appreciated. The code for the form can be seen below.</p>

<pre class="lang-twig prettyprint-override"><code>&lt;form method="post" accept-charset="UTF-8" id="customForm"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;
    &lt;li&gt;
        &lt;div class="input-container"&gt;
            &lt;label for="secondaryEmailAddress"&gt;Secondary Email Address&lt;/label&gt;
            &lt;input id="secondaryEmailAddress" type="email" class="signup-input" name="fields[secondaryEmailAddress]" value="{{ currentUser.secondaryEmailAddress }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/email.png"&gt;
        &lt;/div&gt;&lt;!-- End Input Container --&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;div class="input-container"&gt;
            &lt;label for="secondaryContactName"&gt;Secondary Contact Name&lt;/label&gt;
            &lt;input  id="secondaryContactName" type="text" class="signup-input" name="fields[secondaryContactName]" value="{{ currentUser.secondaryContactName }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/username.png"&gt;
        &lt;/div&gt;&lt;!-- End Input Container --&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;div class="input-container"&gt;
            &lt;label for="zipCode"&gt;Zip Code&lt;/label&gt;
            &lt;input  id="zipCode" type="text" class="signup-input" name="fields[zipCode]" value="{{ currentUser.zipCode }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/zipcode.png"&gt;
        &lt;/div&gt;&lt;!-- End Input Container --&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;div class="input-container"&gt;
            &lt;label for="describeYourself"&gt;Describe Yourself&lt;/label&gt;
            &lt;input id="describeYourself" readonly type="text" class="signup-input" name="fields[describeYourself]" value="{{ currentUser.describeYourself.label }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/learner.png"&gt;
            &lt;img class="dropdown-arrow" src="{{ siteUrl }}assets/img/global/chevron-down.png" /&gt;
        &lt;/div&gt;&lt;!-- End Input Container --&gt;
    &lt;/li&gt;
    &lt;div class="profile-dropdown" id="describeDropdown"&gt;
        &lt;ul&gt;
            {% for option in currentUser.describeYourself.options %}
                &lt;li&gt;{{ option.label }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;li class="conditionalDropdown" id="myAgeItem"&gt;
        &lt;div class="input-container"&gt;
            &lt;label&gt;My Age&lt;/label&gt;
            &lt;input id="myAge" readonly type="text" class="signup-input" name="fields[myAge]" value="{{ currentUser.myAge.label }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/learner-type.png"&gt;
            &lt;img class="dropdown-arrow" src="{{ siteUrl }}assets/img/global/chevron-down.png" /&gt;
        &lt;/div&gt;
    &lt;/li&gt;
    &lt;div class="profile-dropdown" id="myAgeDropdown"&gt;
        &lt;ul&gt;
            {% for option in currentUser.myAge.options %}
                &lt;li&gt;{{ option.label }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;li class="conditionalDropdown" id="learnerAgeItem"&gt;
        &lt;div class="input-container"&gt;
            &lt;label&gt;Learner Age&lt;/label&gt;
            &lt;input id="learnerAge" readonly type="text" class="signup-input" name="fields[learnerAge]" value="{{ currentUser.learnerAge.label }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/learner-type.png"&gt;
            &lt;img class="dropdown-arrow" src="{{ siteUrl }}assets/img/global/chevron-down.png" /&gt;
        &lt;/div&gt;
    &lt;/li&gt;
    &lt;div class="profile-dropdown" id="learnerAgeDropdown"&gt;
        &lt;ul&gt;
            {% for option in currentUser.learnerAge.options %}
                &lt;li&gt;{{ option.label }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;li class="conditionalDropdown" id="teacherItem"&gt;
        &lt;div class="input-container"&gt;
            &lt;label&gt;Grades&lt;/label&gt;
            &lt;input id="grades" readonly type="text" class="signup-input" name="fields[grades]" value="{{ currentUser.grades.label }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/learner-type.png"&gt;
            &lt;img class="dropdown-arrow" src="{{ siteUrl }}assets/img/global/chevron-down.png" /&gt;
        &lt;/div&gt;
    &lt;/li&gt;
    &lt;div class="profile-dropdown" id="gradesDropdown"&gt;
        &lt;ul&gt;
            {% for option in currentUser.grades.options %}
                &lt;li&gt;{{ option.label }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;li&gt;
        &lt;div class="input-container"&gt;
            &lt;label for="howDidYouFindUs"&gt;How Did You Find Us?&lt;/label&gt;
            &lt;input id="howDidYouFindUs" readonly type="text" class="signup-input" name="fields[howDidYouFindUs]" value="{{ currentUser.howDidYouFindUs.label }}"&gt;
            &lt;img src="{{ siteUrl }}assets/img/forms/online-search.png"&gt;
            &lt;img class="dropdown-arrow" src="{{ siteUrl }}assets/img/global/chevron-down.png" /&gt;
        &lt;/div&gt;
    &lt;/li&gt;
    &lt;div class="profile-dropdown" id="findUsDropdown"&gt;
        &lt;ul&gt;
            {% for option in currentUser.howDidYouFindUs.options %}
                &lt;li&gt;{{ option.label }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;input class="button" type="submit" value="Save Profile"&gt;
&lt;/form&gt;
</code></pre>

<p>Thanks</p>

CC BY-SA 3.0
2017-10-27T15:30:08.903Z
Are any of those fields marked as required in the CP?
RitterKnight
CC BY-SA 3.0
2017-10-27T16:48:54.327Z
No, none of them are
bgrnwd
CC BY-SA 3.0
2017-10-27T18:09:26.110Z
Probably some validation error, I'd guess... if you check `user.getErrors()` in the template after submit, does it have any?
Brad Bell
CC BY-SA 3.0
2017-10-27T19:57:06.830Z
@BradBell Can you provide clarification on how exactly I would use `user.getErrors()`? Perused the Craft docs but didn't see anything
bgrnwd
CC BY-SA 3.0
2017-10-27T20:39:51.670Z
Similar to the error handling logic here: https://craftcms.com/docs/templating/user-registration-form
Brad Bell
CC BY-SA 3.0
2017-11-04T18:25:47.637Z
Realized my issue, I was sending back the label values instead of the option values for the custom dropdown fields in the form.
bgrnwd
<templating><form><frontend-form>
User Profile Form Not Saving Data
# User Profile Form Not Saving Data

(Asked by: username_0 on 2017-10-27)

I'm having some trouble saving custom user fields via a front-end form as described here. All the other forms on the site that use the same method save the data correctly. I'm able to pull in the user data correctly if I manually input it in the Craft dashboard. I examined the POST request from the form in devtools and I get a 200 status code so it seems like it's posting the data correctly, however it doesn't seem to be saving on Craft's side.
Any help would be appreciated. The code for the form can be seen below.

    {{ getCsrfInput() }}
    
    
    
        
            Secondary Email Address
            
            
        
    
    
        
            Secondary Contact Name
            
            
        
    
    
        
            Zip Code
            
            
        
    
    
        
            Describe Yourself
            
            
            
        
    
    
        
            {% for option in currentUser.describeYourself.options %}
                {{ option.label }}
            {% endfor %}
        
    
    
        
            My Age
            
            
            
        
    
    
        
            {% for option in currentUser.myAge.options %}
                {{ option.label }}
            {% endfor %}
        
    
    
        
            Learner Age
            
            
            
        
    
    
        
            {% for option in currentUser.learnerAge.options %}
                {{ option.label }}
            {% endfor %}
        
    
    
        
            Grades
            
            
            
        
    
    
        
            {% for option in currentUser.grades.options %}
                {{ option.label }}
            {% endfor %}
        
    
    
        
            How Did You Find Us?
            
            
            
        
    
    
        
            {% for option in currentUser.howDidYouFindUs.options %}
                {{ option.label }}
            {% endfor %}
        
    
    


Thanks

**Tags:** templating, form, frontend-form
> **Comments:**
> **username_1**: Are any of those fields marked as required in the CP?  
> **username_0**: No, none of them are  
> **username_2**: Probably some validation error, I'd guess... if you check `user.getErrors()` in the template after submit, does it have any?  
> **username_0**: @BradBell Can you provide clarification on how exactly I would use `user.getErrors()`? Perused the Craft docs but didn't see anything  
> **username_2**: Similar to the error handling logic here: https://craftcms.com/docs/templating/user-registration-form  
> **username_0**: Realized my issue, I was sending back the label values instead of the option values for the custom dropdown fields in the form.  

---

## 1 answers

### Answer by username_0 on 2017-11-06. Score: 1 | Accepted answer

Realized my issue, I was sending back the option labels instead of the option values for the dropdown fields in the form.


---

