Login

Show all form errors

Author:
timbroder
Posted:
June 15, 2012
Language:
HTML/template
Version:
1.4
Tags:
forms error errors
Score:
1 (after 1 ratings)

showing all the errors at the top of the page

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{% if form.errors %}
	<!-- Error messaging -->
	<div id="errors">
		<div class="inner">
			<p>There were some errors in the information you entered. Please correct the following:</p>
			{{ form.non_field_errors }}
			<ul>
				{% for field in form %}
					{% if field.errors %}<li>{{ field.label }}: {{ field.errors|striptags }}</li>{% endif %}
				{% endfor %}
			</ul>
		</div>
	</div>
	<!-- /Error messaging -->
{% endif %}

More like this

  1. Nice form errors by SmileyChris 5 years, 4 months ago
  2. List all Form Errors by epicserve 6 years, 5 months ago
  3. List all errors in a form +bootstrap highlighting by ibrahimlawal 2 years, 5 months ago
  4. tag: render form field by crucialfelix2 5 years, 3 months ago
  5. Extended rails flash implementation by miracle2k 7 years, 7 months ago

Comments

Please login first before commenting.