Fix new checkboxes

Problems:
- WTForms expects the value of checkboxes to always be `y` (they don’t
  work like radio buttons, which is where I copied this code for)
- WTForms `BooleanField`s don’t have a checked attribute, they set their
  data attibute to `True` or `False`
This commit is contained in:
Chris Hill-Scott
2017-04-11 17:47:16 +01:00
parent 04da9359ef
commit d58be228dd

View File

@@ -5,8 +5,8 @@
) %}
<div class="multiple-choice">
<input
id="{{ field.id }}" name="{{ field.name }}" type="checkbox" value="{{ field.data }}"
{% if field.checked %}
id="{{ field.id }}" name="{{ field.name }}" type="checkbox" value="y"
{% if field.data %}
checked
{% endif %}
>