<p>Correct, you need to use <code>fields[customFieldName]</code> as the input name.</p>

<p>The following form should do it:</p>

<pre><code>&lt;form method="POST"&gt;
    &lt;input type="hidden" name="action" value="commerce/cart/updateCart"&gt;
    &lt;input type="text" name="fields[myCustomField]" value="Test123"&gt;
    ...
    &lt;input type="submit" value="Update Custom Field"&gt;
&lt;/form&gt;
</code></pre>

CC BY-SA 3.0
2016-09-18T00:51:16.427Z
Validation would need to be front end only for now.
Luke Holder
CC BY-SA 3.0
2016-01-06T08:24:45.410Z
Sweet! Is there also a way to validate those fields?
exophunk
CC BY-SA 3.0
2016-01-06T08:16:06.907Z
2016-09-18T00:50:30.427Z
2016-09-18T00:50:30.427Z
Luke Holder
<p>I am struggling with using additional custom order fields. (Added in the Craft Commerce settings at "order fields", in the field layout manager)</p>

<p>I try to update them like this in the checkout process:</p>

<pre><code>&lt;form method="POST"&gt;
    &lt;input type="hidden" name="action" value="commerce/cart/updateCart"&gt;
    &lt;input type="text" name="myCustomField" value="Test123"&gt;
    ...
    &lt;input type="submit" value="Update Custom Field"&gt;
&lt;/form&gt;
</code></pre>

<p>But in the Order in the CP, the field stays empty. Do I have to use another <code>name</code> for the field, like <code>fields[myCustomField]</code> or whatever?</p>

<p>I can update them in the CP, but not from the front-end...</p>

<custom-field><plugin-craftcommerce>
How can I update custom order fields in the frontend
# How can I update custom order fields in the frontend

(Asked by: username_0 on 2016-01-06)

I am struggling with using additional custom order fields. (Added in the Craft Commerce settings at "order fields", in the field layout manager)
I try to update them like this in the checkout process:

    
    
    ...
    


But in the Order in the CP, the field stays empty. Do I have to use another name for the field, like fields[myCustomField] or whatever?
I can update them in the CP, but not from the front-end...

**Tags:** custom-field, plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2016-01-06. Score: 12 | Accepted answer

Correct, you need to use fields[customFieldName] as the input name.
The following form should do it:

    
    
    ...

> **Comments:**
> **username_0**: Sweet! Is there also a way to validate those fields?  
> **username_1**: Validation would need to be front end only for now.  

---

