Added handling of visible/hidden fields (fixes issue where labels/wrapping elements of hidden fields were being rendered). Also added form.non_field_errors to form template.

This commit is contained in:
Matt Austin
2011-09-14 11:39:44 +08:00
parent 38b97b81f6
commit f5ed04d648

View File

@@ -1,7 +1,13 @@
{% load bootstrap %} {% load bootstrap %}
{% for field in form %} {{ form.non_field_errors }}
<div class="clearfix {% if field.errors %}error{% endif %}">
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
{% for field in form.visible_fields %}
<div class="clearfix{% if field.errors %} error{% endif %}">
{% if field|is_checkbox %} {% if field|is_checkbox %}
<ul class="inputs-list"> <ul class="inputs-list">
<li> <li>
@@ -25,3 +31,4 @@
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}