<p>You can use this </p>

<pre><code>{% if entry.hasErrors() %}
    Render a message here
{% endif %}
</code></pre>

CC BY-SA 4.0
2018-06-22T19:57:12.527Z
2018-06-22T20:02:20.827Z
2018-06-22T20:02:20.827Z
Robin Schambach
<p>I have a guest entry form that's working fine. I'm using Craft-supplied code:</p>

<pre><code>{% macro errorList(errors) %}
  {% if errors %}
    {% for error in errors %}
      {{ error }}{% if not loop.last %}, {% endif %} 
    {% endfor %}
  {% endif %}
{% endmacro %}
</code></pre>

<p>And it works fine - field by field:</p>

<pre><code>{% if entry is defined %}
  &lt;p class="help alert"&gt;{{ errorList(entry.getErrors('title')) }}&lt;/p&gt;
{% endif %}
</code></pre>

<p>But I can't figure out how to check if there are any errors (and error in any field) so I can display a notification at the top of the page: "There were some problems with your submission".</p>

<pre><code>{% if errorList(entry.getErrors())|length }}
</code></pre>

<p>doesn't work.</p>

<error><guest-entries><frontend-form>
Check for errors (any) on guest entry form (Craft 3)
# Check for errors (any) on guest entry form (Craft 3)

(Asked by: username_0 on 2018-06-22)

I have a guest entry form that's working fine. I'm using Craft-supplied code:
{% macro errorList(errors) %}
  {% if errors %}
    {% for error in errors %}
      {{ error }}{% if not loop.last %}, {% endif %} 
    {% endfor %}
  {% endif %}
{% endmacro %}

And it works fine - field by field:
{% if entry is defined %}
  {{ errorList(entry.getErrors('title')) }}
{% endif %}

But I can't figure out how to check if there are any errors (and error in any field) so I can display a notification at the top of the page: "There were some problems with your submission".
{% if errorList(entry.getErrors())|length }}

doesn't work.

**Tags:** error, guest-entries, frontend-form


---

## 1 answers

### Answer by username_1 on 2018-06-22. Score: 2 | Accepted answer

You can use this 
{% if entry.hasErrors() %}
    Render a message here
{% endif %}


---

