Answers.Body: <p>When using multiple fields, you'll need to use <code>message[body]</code> for the main message field's <code>name</code> attribute. Passing just <code>message</code> as the name for your main text field will clobber your other custom fields that precede it, as will custom fields, if they appear after it.</p>
  
  <p>I think the only fix you'll need in this case is to the “Comments” <code>textarea</code>:</p>
  
  <pre><code>&lt;textarea name="message[body]"&gt;Your initial text&lt;/textarea&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T00:56:00.623Z
Answers.LastActivityDate: 2018-06-01T00:56:00.623Z
Answers.UserDisplayName: August Miller
Body: <p>I'm working in a form with five fields, but I'm only receiving the content in the comments field; I'm not getting anything from the other four, please check my code
  below.</p>
  
  <pre><code>&lt;div class="form-container"&gt;
      &lt;h3 class="aside-form__title"&gt;{{ block.contactFormHeadline }}&lt;/h3&gt;
      {% macro errorList(errors) %}
      {% if message is defined %}
          {% if errors %}
              {% for error in errors %}
                  &lt;small class="error"&gt;{{ error }}&lt;/small&gt;
              {% endfor %}
          {% endif %}
          {% endif %}
      {% endmacro %}
      {% from _self import errorList %}
      &lt;form method="POST" action=""&gt;
          {{ getCsrfInput() }}
          &lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;
          &lt;div class="form-group"&gt;
              &lt;input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}" placeholder="Full Name"&gt;
              {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;input type="email" name="fromEmail" id="from-email" class="form-control" placeholder="Email" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}"&gt;
              {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;input type="text" name="message[Company]" id="company" class="form-control" placeholder="Company Name" value=""&gt;
  
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;input id="phone" type="text" name="message[Phone]" value="" Placeholder="Phone Number"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;textarea rows="3" cols="30" id="message" name="message" placeholder="Comments"&gt;{% if message is defined %}{{ message.message }}{% endif %}&lt;/textarea&gt;
              {{ message is defined and message ? errorList(message.getErrors('message')) }}
          &lt;/div&gt;
           &lt;div class="form-group"&gt;
          &lt;input type="submit" class="Btn mini-form" value="Submit"&gt;
           &lt;/div&gt;
          &lt;input type="text" name="sales" id="sales" class="hidden"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
Tags: <plugin-contactform>
Title: Contact form plugin only sending the content of the textarea?
ThreadText: # Contact form plugin only sending the content of the textarea?
  
  (Asked by: username_0 on 2018-05-31)
  
  I'm working in a form with five fields, but I'm only receiving the content in the comments field; I'm not getting anything from the other four, please check my code
  below.
  
  ```
  <div class="form-container">
      <h3 class="aside-form__title">{{ block.contactFormHeadline }}</h3>
      {% macro errorList(errors) %}
      {% if message is defined %}
          {% if errors %}
              {% for error in errors %}
                  <small class="error">{{ error }}</small>
              {% endfor %}
          {% endif %}
          {% endif %}
      {% endmacro %}
      {% from _self import errorList %}
      <form method="POST" action="">
          {{ getCsrfInput() }}
          <input type="hidden" name="action" value="contactForm/sendMessage">
          <div class="form-group">
              <input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}" placeholder="Full Name">
              {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
          </div>
          <div class="form-group">
              <input type="email" name="fromEmail" id="from-email" class="form-control" placeholder="Email" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}">
              {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
          </div>
          <div class="form-group">
              <input type="text" name="message[Company]" id="company" class="form-control" placeholder="Company Name" value="">
  
          </div>
          <div class="form-group">
              <input id="phone" type="text" name="message[Phone]" value="" Placeholder="Phone Number">
          </div>
          <div class="form-group">
              <textarea rows="3" cols="30" id="message" name="message" placeholder="Comments">{% if message is defined %}{{ message.message }}{% endif %}</textarea>
              {{ message is defined and message ? errorList(message.getErrors('message')) }}
          </div>
           <div class="form-group">
          <input type="submit" class="Btn mini-form" value="Submit">
           </div>
          <input type="text" name="sales" id="sales" class="hidden">
      </form>
  </div>
  
  ```
  
  **Tags:** plugin-contactform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-01. Score: 2 | Accepted answer
  
  When using multiple fields, you'll need to use `message[body]` for the main message field's `name` attribute. Passing just `message` as the name for your main text field will clobber your other custom fields that precede it, as will custom fields, if they appear after it.
  
  I think the only fix you'll need in this case is to the “Comments” `textarea`:
  
  ```
  <textarea name="message[body]">Your initial text</textarea>
  
  ```
  
  
  ---
  
  