Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-20T20:24:28.460Z
Answers.Text: 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...
Answers.UserDisplayName: noregt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-20T17:09:22.447Z
Answers.LastActivityDate: 2015-01-20T17:09:22.447Z
Answers.UserDisplayName: Fabio Carriere
Body: <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>
  
Tags: <plugin-contactform><error>
Title: P&T Contacform plugin: what's the use of the errors if fields are not required?
ThreadText: # 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](https://github.com/pixelandtonic/ContactForm#usage) 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:
  
  ```
  <input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}">
  {{ 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...  
  
  ---
  
  