Correctly set the checkboxes twig/js (continued the work of Djamil here: 181c3b55e7) Fixes #34

This commit is contained in:
Flavio Copes
2015-08-10 18:08:19 +02:00
parent 09d176cab5
commit f3bc2e1133
2 changed files with 2 additions and 2 deletions

View File

@@ -84,7 +84,7 @@
formValues = {};
for (var key in values) { if (values.hasOwnProperty(key)) {
formValues[name + '[' + key + ']'] = values[key] ? '1' : '0';
formValues[key] = values[key] ? '1' : '0';
}
}

View File

@@ -24,7 +24,7 @@
<input type="checkbox"
id="{{ id|e }}"
value="{{ val|e }}"
name="{{ name|fieldName }}"
name="{{ field.name|fieldName ~ '[' ~ name ~ ']' }}"
{% if checked %}checked="checked"{% endif %}
{% if field.validate.required %}required="required"{% endif %}
>