Login

Show all form errors

Author:
timbroder
Posted:
June 15, 2012
Language:
HTML/template
Version:
1.4
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. Bootstrap Accordian by Netplay4 5 years, 10 months ago
  2. Bootstrap theme for django-endless-pagination? by se210 8 years, 10 months ago
  3. Bootstrap theme for django-endless-pagination? by se210 8 years, 10 months ago
  4. Reusable form template with generic view by roldandvg 8 years, 11 months ago
  5. Pagination Django with Boostrap by guilegarcia 9 years, 1 month ago

Comments

Please login first before commenting.