mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-04-04 19:58:49 +02:00
Correctly set the checkboxes twig/js (continued the work of Djamil here: 181c3b55e7) Fixes #34
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 %}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user