<p>I'm not sure if this is the intended way, but I rigged this up and so far it works well.</p>

<pre><code>{% set yankee = craft.amForms.getForm('hotel') %}

{% macro foxtrot(errors) %}
    {% if errors %}
        &lt;ul class="errors"&gt;
            {% for error in errors %}
                &lt;li&gt;{{ error }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    {% endif %}
{% endmacro %}

{% from _self import foxtrot %}

{# list of form errors #}
{% if hotel is defined %}
    &lt;div class="error-class"&gt;
        {% set fields = yankee.getFields() %}
        &lt;h4&gt;Please correct the errors listed below before submitting the form.&lt;/h4&gt;
        &lt;ol&gt;
            {% for field in fields %}
                {{ foxtrot(hotel.getErrors(field.handle)) }}
            {% endfor %}
        &lt;/ol&gt;
    &lt;/div&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-09-04T01:39:43.083Z
2017-09-04T01:39:43.083Z
Ryan
<p>I'm using <a href="https://github.com/am-impact/amforms" rel="nofollow noreferrer">amforms</a> and would like to display all form errors at the top of my page, not just per field. I can't seem to find the answer in the docs. Is this option available?</p>

CC BY-SA 3.0
2017-09-04T01:26:49.390Z
Never used the plugin, but looking at the docs, I'd suspect `formHandle.getErrors()` would return a multi-dimensional array with the key being the attribute and the values being an array of errors.
Brad Bell
<validation><plugin-amforms>
Show all form errrors using amforms
# Show all form errrors using amforms

(Asked by: username_0 on 2017-09-03)

I'm using [amforms](https://github.com/am-impact/amforms) and would like to display all form errors at the top of my page, not just per field. I can't seem to find the answer in the docs. Is this option available?

**Tags:** validation, plugin-amforms

> **Comments:**
> **username_1**: Never used the plugin, but looking at the docs, I'd suspect `formHandle.getErrors()` would return a multi-dimensional array with the key being the attribute and the values being an array of errors.  

---

## 1 answers

### Answer by username_0 on 2017-09-04. Score: 1 | Accepted answer

I'm not sure if this is the intended way, but I rigged this up and so far it works well.
{% set yankee = craft.amForms.getForm('hotel') %}

{% macro foxtrot(errors) %}
    {% if errors %}
        
            {% for error in errors %}
                {{ error }}
            {% endfor %}
        
    {% endif %}
{% endmacro %}

{% from _self import foxtrot %}

{# list of form errors #}
{% if hotel is defined %}
    
        {% set fields = yankee.getFields() %}
        Please correct the errors listed below before submitting the form.
        
            {% for field in fields %}
                {{ foxtrot(hotel.getErrors(field.handle)) }}
            {% endfor %}
        
    
{% endif %}


---

