From 7443252c528be759a44ca3be771a19e8ecccc110 Mon Sep 17 00:00:00 2001 From: Glenn Griffin Date: Tue, 14 Jan 2014 23:52:13 +0000 Subject: [PATCH] Handle multiple checkboxes better --- .../templates/bootstrapform/field.html | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bootstrapform/templates/bootstrapform/field.html b/bootstrapform/templates/bootstrapform/field.html index bfbdf64..b269dc6 100644 --- a/bootstrapform/templates/bootstrapform/field.html +++ b/bootstrapform/templates/bootstrapform/field.html @@ -44,12 +44,32 @@

{% endif %} + {% elif field|is_multiple_checkbox %} + {% if field.auto_id %} + + {% endif %} +
+ {% for choice in field %} +
+ {{ choice.choice_label }} +
+ {% endfor %} + {% for error in field.errors %} + {{ error }} + {% endfor %} + + {% if field.help_text %} +

+ {{ field.help_text|safe }} +

+ {% endif %} +
{% else %} {% if field.auto_id %} {% endif %} -
+
{{ field }} {% for error in field.errors %}