<p>In the ContactFormModel you can manage the attribute 'required' => true.</p>

<p>The example just show how to use the getErrors for each field.</p>

<p>You can delete the ones you dont need.</p>

CC BY-SA 3.0
2015-01-20T20:24:28.460Z
Thanks, just wanted to make sure about that. Since that attribute requires a hack in the plugin, I'd rather see only the supported errors...
noregt
CC BY-SA 3.0
2015-01-20T17:09:22.447Z
2015-01-20T17:09:22.447Z
Fabio Carriere
<p>In the <a href="https://github.com/pixelandtonic/ContactForm#usage" rel="nofollow">Contactform plugin page</a> there's a code example that's confusing me.</p>

<p>Only the email and message are required in the code, but the fromName field does have an error syntax:</p>

<pre><code>&lt;input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}
</code></pre>

<p>What's the use of the getErrors here? I've tried using rare characters, but no errors?</p>

<plugin-contactform><error>
P&T Contacform plugin: what's the use of the errors if fields are not required?
# P&T Contacform plugin: what's the use of the errors if fields are not required?

(Asked by: username_0 on 2015-01-20)

In the Contactform plugin page there's a code example that's confusing me.
Only the email and message are required in the code, but the fromName field does have an error syntax:

{{ message is defined and message ? errorList(message.getErrors('fromName')) }}

What's the use of the getErrors here? I've tried using rare characters, but no errors?

**Tags:** plugin-contactform, error

---

## 1 answers

### Answer by username_1 on 2015-01-20. Score: 2 | Accepted answer

In the ContactFormModel you can manage the attribute 'required' => true.

The example just show how to use the getErrors for each field.

You can delete the ones you dont need.

> **Comments:**
> **username_0**: Thanks, just wanted to make sure about that. Since that attribute requires a hack in the plugin, I'd rather see only the supported errors...  

---

