Errors
When a form submission encounters a validation error, this Tag allows you to show your user where everything went south.
Example
This tag can be used both as a conditional and as the data itself.
{{ 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 }}
Note that since form:errors
is a Tag rather than a variable, it should be wrapped with single braces when
inside the conditional.
Parameters
formset|in
string |
The name of the formset this tag should be targeting. This is only required if you do not use the |
---|
Variables
value
string |
The output of the errors tag is a primitive array. That means in each iteration the |
---|