<p>The First Name and other built-in fields are kind of special. You can access them directly without having to prefix them with <code>fields</code>.</p>

<p>To use other custom fields, try using bracket syntax instead of dot syntax.</p>

<p>For example:</p>

<pre><code>&lt;div class="form-group"&gt;
    &lt;label for="address"&gt;
        Street Address&lt;span&gt;&lt;small&gt;&lt;i class="fa fa-asterisk"&gt;&lt;/i&gt;&lt;/small&gt;&lt;/span&gt;
    &lt;/label&gt;
    &lt;input type="text" name="fields[address][name]" class="form-control" {%- if currentUser is defined %} value="{{ currentUser.address.name }}"{% endif -%}&gt;
    {{ currentUser is defined and currentUser ? errorList(currentUser.getErrors('address.name')) }}
&lt;/div&gt;
</code></pre>

<p>Hope this helps!</p>

CC BY-SA 3.0
2017-10-27T03:32:32.410Z
2017-10-27T03:32:32.410Z
Damon
<p>I think that instead of </p>

<pre><code>fields[currentUser.address.city]
</code></pre>

<p>you need to refer to the fields like this</p>

<pre><code>fields[address.city]
</code></pre>

<p>or even</p>

<pre><code>fields[address][city]
</code></pre>

<p>perhaps even</p>

<pre><code>fields[0][address][city]
</code></pre>

<p>In retrospect, this answer isn't very helpful.</p>

CC BY-SA 3.0
2017-10-25T16:48:14.510Z
It turns out, for my custom fields this works <input type="text" id="city" name="fields[address][city]" value="{{ currentUser.address.city }}">.  Technically Damon's "answer" is correct but thank you so much for chiming in!
Todd
CC BY-SA 3.0
2017-10-25T16:15:47.910Z
2017-10-25T16:15:47.910Z
foamcow
<p>This is my first attempt at setting up a front-end form so my users can update their profile information.  The profile is using the VZ Address plugin for the address field.</p>

<p>When I go to the page, it pulls all of my details in.  When I update something on the front-end and submit, I get a confirmation message ("Your profile has been updated.") that it went fine, but the fields are not updated. I have template debugging turned on and there are no errors.</p>

<p>Here is my form</p>

<pre><code>{% block content %}
&lt;div class="cell small-12 medium-9"&gt;
    {% if craft.session.getFlash('notice') == 'User saved.'|t %}
    &lt;div class="grid-x"&gt;
        &lt;div class="cell"&gt;
            &lt;div class="callout alert"&gt;Your profile has been updated.&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    {% endif %}

    &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="/clients/account/profile"&gt;
        &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&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;div class="grid-x grid-padding-x"&gt;
            &lt;fieldset class="cell small-12"&gt;
                &lt;label for="firstName"&gt;Mailing Name&lt;/label&gt;&lt;input type="text" id="currentUser.address.name" name="fields[currentUser.address.name]" value="{{ currentUser.address.name }}"&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
        &lt;div class="grid-x grid-padding-x"&gt;
            &lt;fieldset class="cell small-12"&gt;
                &lt;label for="firstName"&gt;Address&lt;/label&gt;&lt;input type="text" id="currentUser.address.street" name="fields[currentUser.address.street]" value="{{ currentUser.address.street }}"&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
        &lt;div class="grid-x grid-padding-x"&gt;
            &lt;fieldset class="cell small-12"&gt;
                &lt;label for="firstName"&gt;Address 2&lt;/label&gt;&lt;input type="text" id="currentUser.address.street2" name="fields[currentUser.address.street2]" value="{{ currentUser.address.street2 }}"&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
    &lt;div class="grid-x grid-padding-x"&gt;
        &lt;fieldset class="cell small-6"&gt;
            &lt;label for="city"&gt;City&lt;/label&gt;&lt;input type="text" id="currentUser.address.city" name="fields[currentUser.address.city]" value="{{ currentUser.address.city }}"&gt;
        &lt;/fieldset&gt;
        &lt;fieldset class="cell small-3"&gt;
            &lt;label for="region"&gt;State
            &lt;select&gt;
                &lt;option value="AL"{%if currentUser.address.region=="AL" %} selected{% endif %}&gt;Alabama&lt;/option&gt;
                &lt;option value="AK"{%if currentUser.address.region=="AK" %} selected{% endif %}&gt;Alaska&lt;/option&gt;
                &lt;option value="AZ"{%if currentUser.address.region=="AZ" %} selected{% endif %}&gt;Arizona&lt;/option&gt;
                &lt;option value="AR"{%if currentUser.address.region=="AR" %} selected{% endif %}&gt;Arkansas&lt;/option&gt;
                &lt;option value="CA"{%if currentUser.address.region=="CA" %} selected{% endif %}&gt;California&lt;/option&gt;
                &lt;option value="CO"{%if currentUser.address.region=="CO" %} selected{% endif %}&gt;Colorado&lt;/option&gt;
                &lt;option value="CT"{%if currentUser.address.region=="CT" %} selected{% endif %}&gt;Connecticut&lt;/option&gt;
                &lt;option value="DE"{%if currentUser.address.region=="DE" %} selected{% endif %}&gt;Delaware&lt;/option&gt;
                &lt;option value="DC"{%if currentUser.address.region=="DC" %} selected{% endif %}&gt;District Of Columbia&lt;/option&gt;
                &lt;option value="FL"{%if currentUser.address.region=="FL" %} selected{% endif %}&gt;Florida&lt;/option&gt;
                &lt;option value="GA"{%if currentUser.address.region=="GA" %} selected{% endif %}&gt;Georgia&lt;/option&gt;
                &lt;option value="HI"{%if currentUser.address.region=="HI" %} selected{% endif %}&gt;Hawaii&lt;/option&gt;
                &lt;option value="ID"{%if currentUser.address.region=="ID" %} selected{% endif %}&gt;Idaho&lt;/option&gt;
                &lt;option value="IL"{%if currentUser.address.region=="IL" %} selected{% endif %}&gt;Illinois&lt;/option&gt;
                &lt;option value="IN"{%if currentUser.address.region=="IN" %} selected{% endif %}&gt;Indiana&lt;/option&gt;
                &lt;option value="IA"{%if currentUser.address.region=="IA" %} selected{% endif %}&gt;Iowa&lt;/option&gt;
                &lt;option value="KS"{%if currentUser.address.region=="KS" %} selected{% endif %}&gt;Kansas&lt;/option&gt;
                &lt;option value="KY"{%if currentUser.address.region=="KY" %} selected{% endif %}&gt;Kentucky&lt;/option&gt;
                &lt;option value="LA"{%if currentUser.address.region=="LA" %} selected{% endif %}&gt;Louisiana&lt;/option&gt;
                &lt;option value="ME"{%if currentUser.address.region=="ME" %} selected{% endif %}&gt;Maine&lt;/option&gt;
                &lt;option value="MD"{%if currentUser.address.region=="MD" %} selected{% endif %}&gt;Maryland&lt;/option&gt;
                &lt;option value="MA"{%if currentUser.address.region=="MA" %} selected{% endif %}&gt;Massachusetts&lt;/option&gt;
                &lt;option value="MI"{%if currentUser.address.region=="MI" %} selected{% endif %}&gt;Michigan&lt;/option&gt;
                &lt;option value="MN"{%if currentUser.address.region=="MN" %} selected{% endif %}&gt;Minnesota&lt;/option&gt;
                &lt;option value="MS"{%if currentUser.address.region=="MS" %} selected{% endif %}&gt;Mississippi&lt;/option&gt;
                &lt;option value="MO"{%if currentUser.address.region=="MO" %} selected{% endif %}&gt;Missouri&lt;/option&gt;
                &lt;option value="MT"{%if currentUser.address.region=="MT" %} selected{% endif %}&gt;Montana&lt;/option&gt;
                &lt;option value="NE"{%if currentUser.address.region=="NE" %} selected{% endif %}&gt;Nebraska&lt;/option&gt;
                &lt;option value="NV"{%if currentUser.address.region=="NV" %} selected{% endif %}&gt;Nevada&lt;/option&gt;
                &lt;option value="NH"{%if currentUser.address.region=="NH" %} selected{% endif %}&gt;New Hampshire&lt;/option&gt;
                &lt;option value="NJ"{%if currentUser.address.region=="NJ" %} selected{% endif %}&gt;New Jersey&lt;/option&gt;
                &lt;option value="NM"{%if currentUser.address.region=="NM" %} selected{% endif %}&gt;New Mexico&lt;/option&gt;
                &lt;option value="NY"{%if currentUser.address.region=="NY" %} selected{% endif %}&gt;New York&lt;/option&gt;
                &lt;option value="NC"{%if currentUser.address.region=="NC" %} selected{% endif %}&gt;North Carolina&lt;/option&gt;
                &lt;option value="ND"{%if currentUser.address.region=="ND" %} selected{% endif %}&gt;North Dakota&lt;/option&gt;
                &lt;option value="OH"{%if currentUser.address.region=="OH" %} selected{% endif %}&gt;Ohio&lt;/option&gt;
                &lt;option value="OK"{%if currentUser.address.region=="OK" %} selected{% endif %}&gt;Oklahoma&lt;/option&gt;
                &lt;option value="OR"{%if currentUser.address.region=="OR" %} selected{% endif %}&gt;Oregon&lt;/option&gt;
                &lt;option value="PA"{%if currentUser.address.region=="PA" %} selected{% endif %}&gt;Pennsylvania&lt;/option&gt;
                &lt;option value="RI"{%if currentUser.address.region=="RI" %} selected{% endif %}&gt;Rhode Island&lt;/option&gt;
                &lt;option value="SC"{%if currentUser.address.region=="SC" %} selected{% endif %}&gt;South Carolina&lt;/option&gt;
                &lt;option value="SD"{%if currentUser.address.region=="SD" %} selected{% endif %}&gt;South Dakota&lt;/option&gt;
                &lt;option value="TN"{%if currentUser.address.region=="TN" %} selected{% endif %}&gt;Tennessee&lt;/option&gt;
                &lt;option value="TX"{%if currentUser.address.region=="TX" %} selected{% endif %}&gt;Texas&lt;/option&gt;
                &lt;option value="UT"{%if currentUser.address.region=="UT" %} selected{% endif %}&gt;Utah&lt;/option&gt;
                &lt;option value="VT"{%if currentUser.address.region=="VT" %} selected{% endif %}&gt;Vermont&lt;/option&gt;
                &lt;option value="VA"{%if currentUser.address.region=="VA" %} selected{% endif %}&gt;Virginia&lt;/option&gt;
                &lt;option value="WA"{%if currentUser.address.region=="WA" %} selected{% endif %}&gt;Washington&lt;/option&gt;
                &lt;option value="WV"{%if currentUser.address.region=="WV" %} selected{% endif %}&gt;West Virginia&lt;/option&gt;
                &lt;option value="WI"{%if currentUser.address.region=="WI" %} selected{% endif %}&gt;Wisconsin&lt;/option&gt;
                &lt;option value="WY"{%if currentUser.address.region=="WY" %} selected{% endif %}&gt;Wyoming&lt;/option&gt;
                &lt;option value=""&gt;&amp;nbsp;&lt;/option&gt;
                &lt;option value="" disabled&gt;-- US Outlying Territories --&lt;/option&gt;
                &lt;option value="AS"{%if currentUser.address.region=="AS" %} selected{% endif %}&gt;American Samoa (AS)&lt;/option&gt;
                &lt;option value="GU"{%if currentUser.address.region=="GU" %} selected{% endif %}&gt;Guam (GU)&lt;/option&gt;
                &lt;option value="MP"{%if currentUser.address.region=="MP" %} selected{% endif %}&gt;Northern Mariana Islands (MP)&lt;/option&gt;
                &lt;option value="PR"{%if currentUser.address.region=="PR" %} selected{% endif %}&gt;Puerto Rico (PR)&lt;/option&gt;
                &lt;option value="UM"{%if currentUser.address.region=="UM" %} selected{% endif %}&gt;United States Minor Outlying Islands (UM)&lt;/option&gt;
                &lt;option value="VI"{%if currentUser.address.region=="VI" %} selected{% endif %}&gt;Virgin Islands (VI)&lt;/option&gt;
                &lt;option value=""&gt;&amp;nbsp;&lt;/option&gt;
                &lt;option value="" disabled&gt;----- Canada Province -----&lt;/option&gt;
                &lt;option value="AB"{%if currentUser.address.region=="AB" %} selected{% endif %}&gt;Alberta&lt;/option&gt;
                &lt;option value="BC"{%if currentUser.address.region=="BC" %} selected{% endif %}&gt;British Columbia&lt;/option&gt;
                &lt;option value="MB"{%if currentUser.address.region=="MB" %} selected{% endif %}&gt;Manitoba&lt;/option&gt;
                &lt;option value="NB"{%if currentUser.address.region=="NB" %} selected{% endif %}&gt;New Brunswick&lt;/option&gt;
                &lt;option value="NL"{%if currentUser.address.region=="NL" %} selected{% endif %}&gt;Newfoundland and Labrador&lt;/option&gt;
                &lt;option value="NS"{%if currentUser.address.region=="NS" %} selected{% endif %}&gt;Nova Scotia&lt;/option&gt;
                &lt;option value="NT"{%if currentUser.address.region=="NT" %} selected{% endif %}&gt;Northwest Territories&lt;/option&gt;
                &lt;option value="NU"{%if currentUser.address.region=="NU" %} selected{% endif %}&gt;Nunavut&lt;/option&gt;
                &lt;option value="ON"{%if currentUser.address.region=="ON" %} selected{% endif %}&gt;Ontario&lt;/option&gt;
                &lt;option value="PE"{%if currentUser.address.region=="PE" %} selected{% endif %}&gt;Prince Edward Island&lt;/option&gt;
                &lt;option value="QC"{%if currentUser.address.region=="QC" %} selected{% endif %}&gt;Quebec&lt;/option&gt;
                &lt;option value="SK"{%if currentUser.address.region=="SK" %} selected{% endif %}&gt;Saskatchewan&lt;/option&gt;
                &lt;option value="YT"{%if currentUser.address.region=="YT" %} selected{% endif %}&gt;Yukon&lt;/option&gt;
            &lt;/select&gt;
            &lt;/label&gt;
        &lt;/fieldset&gt;
        &lt;fieldset class="cell small-3"&gt;
            &lt;label for="postalCode"&gt;Zip Code&lt;/label&gt;&lt;input type="text" id="address.postalCode" name="fields[address.postalCode]" value="{{ currentUser.address.postalCode }}"&gt;
        &lt;/fieldset&gt;
        &lt;/div&gt;
        &lt;input type="submit" value="Save Profile"&gt;
    &lt;/form&gt;
&lt;/div&gt;
{% endblock %}
</code></pre>

<p>If I update the information in the CP, then the new information is displayed on the front end.</p>

<p>The "action" value of "users/saveUser" - is this something that I need to create, or is it a system file?</p>

<p>I'm stumped.</p>

CC BY-SA 3.0
2017-10-25T14:12:45.790Z
What happens if you try using bracket instead of dot syntax for your field names? For example, `...type="text" name="fields[address][name]"...`?
Damon
CC BY-SA 3.0
2017-10-25T15:41:20.620Z
Same - tells me that it updated successfully, but still the old information.
Todd
CC BY-SA 3.0
2017-10-25T16:32:38.107Z
Actually, this does work for my custom fields (not for the built-in fields though like firstName, lastName, email).
Todd
CC BY-SA 3.0
2017-10-25T16:48:38.420Z
I figured out the "built-in" fields.  If you can add your comment as an answer I will give you credit!
Todd
<users><frontend>
Unable to get front-end Profile form to save changes
# Unable to get front-end Profile form to save changes

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

This is my first attempt at setting up a front-end form so my users can update their profile information.  The profile is using the VZ Address plugin for the address field.
When I go to the page, it pulls all of my details in.  When I update something on the front-end and submit, I get a confirmation message ("Your profile has been updated.") that it went fine, but the fields are not updated. I have template debugging turned on and there are no errors.
Here is my form
{% block content %}

    {% if craft.session.getFlash('notice') == 'User saved.'|t %}
    
        
            Your profile has been updated.
        
    
    {% endif %}

    
        {{ getCsrfInput() }}
        
        
        

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

        
            
                Mailing Name
            
        
        
            
                Address
            
        
        
            
                Address 2
            
        
    
        
            City
        
        
            State
            
                Alabama
                Alaska
                Arizona
                Arkansas
                California
                Colorado
                Connecticut
                Delaware
                District Of Columbia
                Florida
                Georgia
                Hawaii
                Idaho
                Illinois
                Indiana
                Iowa
                Kansas
                Kentucky
                Louisiana
                Maine
                Maryland
                Massachusetts
                Michigan
                Minnesota
                Mississippi
                Missouri
                Montana
                Nebraska
                Nevada
                New Hampshire
                New Jersey
                New Mexico
                New York
                North Carolina
                North Dakota
                Ohio
                Oklahoma
                Oregon
                Pennsylvania
                Rhode Island
                South Carolina
                South Dakota
                Tennessee
                Texas
                Utah
                Vermont
                Virginia
                Washington
                West Virginia
                Wisconsin
                Wyoming
                 
                -- US Outlying Territories --
                American Samoa (AS)
                Guam (GU)
                Northern Mariana Islands (MP)
                Puerto Rico (PR)
                United States Minor Outlying Islands (UM)
                Virgin Islands (VI)
                 
                ----- Canada Province -----
                Alberta
                British Columbia
                Manitoba
                New Brunswick
                Newfoundland and Labrador
                Nova Scotia
                Northwest Territories
                Nunavut
                Ontario
                Prince Edward Island
                Quebec
                Saskatchewan
                Yukon
            
            
        
        
            Zip Code
        
        
        
    

{% endblock %}

If I update the information in the CP, then the new information is displayed on the front end.
The "action" value of "users/saveUser" - is this something that I need to create, or is it a system file?
I'm stumped.

**Tags:** users, frontend
> **Comments:**
> **username_1**: What happens if you try using bracket instead of dot syntax for your field names? For example, `...type="text" name="fields[address][name]"...`?  
> **username_0**: Same - tells me that it updated successfully, but still the old information.  
> **username_0**: Actually, this does work for my custom fields (not for the built-in fields though like firstName, lastName, email).  
> **username_0**: I figured out the "built-in" fields.  If you can add your comment as an answer I will give you credit!  

---

## 2 answers

### Answer by username_1 on 2017-10-27. Score: 2 | Accepted answer

The First Name and other built-in fields are kind of special. You can access them directly without having to prefix them with fields.
To use other custom fields, try using bracket syntax instead of dot syntax.
For example:

    
        Street Address
    
    
    {{ currentUser is defined and currentUser ? errorList(currentUser.getErrors('address.name')) }}


Hope this helps!


---

### Answer by username_2 on 2017-10-25. Score: 1

I think that instead of 
fields[currentUser.address.city]

you need to refer to the fields like this
fields[address.city]

or even
fields[address][city]

perhaps even
fields[0][address][city]

In retrospect, this answer isn't very helpful.

> **Comments:**
> **username_0**: It turns out, for my custom fields this works <input type="text" id="city" name="fields[address][city]" value="{{ currentUser.address.city }}">.  Technically Damon's "answer" is correct but thank you so much for chiming in!  

---

