<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>

CC BY-SA 4.0
2018-06-01T00:56:00.623Z
2018-06-01T00:56:00.623Z
August Miller
<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>

<plugin-contactform>
Contact form plugin only sending the content of the textarea?
# 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.

    {{ block.contactFormHeadline }}
    {% macro errorList(errors) %}
    {% if message is defined %}
        {% if errors %}
            {% for error in errors %}
                {{ error }}
            {% endfor %}
        {% endif %}
        {% endif %}
    {% endmacro %}
    {% from _self import errorList %}
    
        {{ getCsrfInput() }}
        
        
            
            {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
        
        
            
            {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
        
        
            

        
        
            
        
        
            {% if message is defined %}{{ message.message }}{% endif %}
            {{ message is defined and message ? errorList(message.getErrors('message')) }}

**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:
Your initial text


---

