From f5ed04d64899730eecf832d61f4873614a00282f Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 11:39:44 +0800 Subject: [PATCH] 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. --- bootstrapform/templates/bootstrapform/form.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bootstrapform/templates/bootstrapform/form.html b/bootstrapform/templates/bootstrapform/form.html index 173b5a5..e22d708 100644 --- a/bootstrapform/templates/bootstrapform/form.html +++ b/bootstrapform/templates/bootstrapform/form.html @@ -1,7 +1,13 @@ {% load bootstrap %} -{% for field in form %} -
+{{ form.non_field_errors }} + +{% for field in form.hidden_fields %} + {{ field }} +{% endfor %} + +{% for field in form.visible_fields %} +
{% if field|is_checkbox %}
  • @@ -25,3 +31,4 @@ {% endif %}
{% endfor %} +