{% comment %} form-error-highlight.html -- simple loop for displaying forms/modelforms. Pretties up forms and conditionally inserts errors and help_text. Uses the following template tags: hidden -- built in for all hidden form fields. form -- the rest of the form. {% endcomment %}
{# Include but don't display hidden fields #} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} {# Include the visible fields #} {% for field in form.visible_fields %} {# if it's an error put it in a red box #} {% if field.errors %}
{{ field.errors }} {% else %}
{% endif %} {{ field.label_tag }}
{{ field }}
{% if field.help_text %}{{ field.help_text }}{% endif %}
{% endfor %}