Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-18T00:51:16.427Z
Answers.Text: Validation would need to be front end only for now.
Answers.UserDisplayName: Luke Holder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-06T08:24:45.410Z
Answers.Text: Sweet! Is there also a way to validate those fields?
Answers.UserDisplayName: exophunk
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-06T08:16:06.907Z
Answers.LastActivityDate: 2016-09-18T00:50:30.427Z
Answers.LastEditDate: 2016-09-18T00:50:30.427Z
Answers.UserDisplayName: Luke Holder
Body: <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>
  
Tags: <custom-field><plugin-craftcommerce>
Title: How can I update custom order fields in the frontend
ThreadText: # 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:
  
  ```
  <form method="POST">
      <input type="hidden" name="action" value="commerce/cart/updateCart">
      <input type="text" name="myCustomField" value="Test123">
      ...
      <input type="submit" value="Update Custom Field">
  </form>
  
  ```
  
  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:
  
  ```
  <form method="POST">
      <input type="hidden" name="action" value="commerce/cart/updateCart">
      <input type="text" name="fields[myCustomField]" value="Test123">
      ...
      <input type="submit" value="Update Custom Field">
  </form>
  
  ```
  
  > **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.  
  
  ---
  
  