I'm having trouble with additional message fields in my Craft Contact Form using Craft 3 and the Pixel & Tonic Contact Form plugin.
I've added two additional fields by splitting up the message field as described in the plugin documentation. If all the fields are filled in, everything goes smoothly. But if the form is submitted with any blank required fields, I get a PHP error "Array to string conversion." Live example at http://striveforfive.creativeforthepeople.org/contact.
EDIT: The code is:
{% if entry.formCopy|length %}{{ entry.formCopy }}{% endif %}
{% macro errorList(errors) %}
{% if errors %}
<ul class="errors">
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% from _self import errorList %}
<form class="contact-form" method="post" action="" accept-charset="UTF-8">
<div class="form-group">
{{ csrfInput() }}
<input type="hidden" class="form-control" name="action" value="contact-form/send">
{{ redirectInput('contact-ty') }}
<input id="from-name" class="form-control" type="text" name="fromName" value="{{ message.fromName ?? '' }}" placeholder="your name">
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}
<input id="from-email" class="form-control" type="email" name="fromEmail" value="{{ message.fromEmail ?? '' }}" placeholder="your email">
{{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
<input id="affiliation" class="form-control" type="text" name="message[Affiliation]" value="" placeholder="your school / organization / home locations">
<select id="position" class="form-control" type="text" name="message[Position]" value="">
<option value="" selected disabled>your position</option>
<option>Educator / Care Giver</option>
<option>Family Child Care Provider</option>
<option>Center Director</option>
<option>Student Teacher</option>
<option>Other</option>
</select>
<textarea rows="5" cols="40" id="message" class="form-control" name="message[body]" placeholder="your message">{{ message.message ?? '' }}</textarea>
{{ message is defined and message ? errorList(message.getErrors('message')) }}
<input id="bluebeard" name="bluebeard" type="text">
<input id="contact-submit" type="submit" class="btn btn-outline-primary" value="Send">
</div>
</form>
All help is appreciated!