# Form:Errors

If a form submission encounters a validation error, you can use this tag to loop through the error messages and show your user where everything went south.


## Example

This tag can be used both as a conditional and as the data itself.

::tabs

::tab antlers
```antlers
{{ form:set is="contact" }}
    {{ if {form:errors} }}
        <p>Oops, here's what went wrong:</p>
        <ul>
            {{ form:errors }}
                <li>{{ value }}</li>
            {{ /form:errors }}
        </ul>
    {{ /if }}

    {{ form:create }}
        ...
    {{ /form:create }}
{{ /form:set }}
```

:::tip
`form:errors` is a Tag, not a variable. Be sure to wrap it with single braces when inside a condition.
:::

::tab blade
```blade
<s:form:set
  is="contact"
>
  <s:form:errors
    as="errors"
  >
    @if (count($errors) > 0)
      <p>Oops, here's what went wrong:</p>
      <ul>
        @foreach($errors as $error)
          <li>{{ $error['value'] }}</li>
        @endforeach
      </ul>
    @endif
  </s:form:errors>

  <s:form:create>
    ...
  </s:form:create>
</s:form:set>
```
::
