Answers.Body: <p>The second parameter of the <code>input</code> function is the name attribute, which you currently have as <code>contactName</code>. Assigning it in the options like you have does not override the initial supplied parameter. Try this:</p>
  <pre><code>{{ input('text', 'fields[contactName]', entry.contactName, {
      id: 'contactName'
  }) }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-25T14:01:34.957Z
Answers.Text: Gotcha! That makes perfect sense. Thanks for talking me through it. Works perfectly now. Much appreciated.
Answers.UserDisplayName: Ed Hebert
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-25T02:09:56.347Z
Answers.LastActivityDate: 2021-02-25T02:09:56.347Z
Answers.UserDisplayName: andrewmenich
Body: <p>I'm working on a front-end entry form with custom text input fields. From the <a href="https://craftcms.com/knowledge-base/entry-form" rel="nofollow noreferrer">Entry Form knowledgebase</a> docs, I read &quot;Any custom field handles must be provided in a fields[] array like body is above.&quot; On that page their example 'body' field is a textarea field, and when I use this with my own textarea fields it works fine. However I'm having trouble formatting that same logic to make a simple plaintext input field work properly.</p>
  <p>My current (non-working) code is:</p>
  <pre><code> &lt;label for=&quot;contactName&quot;&gt;Contact Name&lt;/label&gt;
    {{ input('text', 'contactName', entry.contactName, {
      id: 'contactName',
      name: 'fields[contactName]'
    }) }}
  </code></pre>
  <p>No errors are being thrown when I submit the form, but the values from the plaintext input area are not being saved. What's the proper way to format such that the input values are saved properly?</p>
  
Tags: <templating><frontend-form>
Title: Front End Entry Form - Proper Syntax for Custom Fields
ThreadText: # Front End Entry Form - Proper Syntax for Custom Fields
  
  (Asked by: username_0 on 2021-02-25)
  
  I'm working on a front-end entry form with custom text input fields. From the [Entry Form knowledgebase](https://craftcms.com/knowledge-base/entry-form) docs, I read "Any custom field handles must be provided in a fields[] array like body is above." On that page their example 'body' field is a textarea field, and when I use this with my own textarea fields it works fine. However I'm having trouble formatting that same logic to make a simple plaintext input field work properly.
  
  My current (non-working) code is:
  
  ```
   <label for="contactName">Contact Name</label>
    {{ input('text', 'contactName', entry.contactName, {
      id: 'contactName',
      name: 'fields[contactName]'
    }) }}
  
  ```
  
  No errors are being thrown when I submit the form, but the values from the plaintext input area are not being saved. What's the proper way to format such that the input values are saved properly?
  
  **Tags:** templating, frontend-form
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-25. Score: 2 | Accepted answer
  
  The second parameter of the `input` function is the name attribute, which you currently have as `contactName`. Assigning it in the options like you have does not override the initial supplied parameter. Try this:
  
  ```
  {{ input('text', 'fields[contactName]', entry.contactName, {
      id: 'contactName'
  }) }}
  
  ```
  
  > **Comments:**
  > **username_0**: Gotcha! That makes perfect sense. Thanks for talking me through it. Works perfectly now. Much appreciated.  
  
  ---
  
  