fix for multiple selects (like taxonomy)

This commit is contained in:
Andy Miller
2015-08-21 12:11:06 -06:00
parent 1d1a973b09
commit 2dce00f05b

View File

@@ -15,7 +15,7 @@
{% if field.form %}form="{{ field.form }}"{% endif %}
>
{% for key, text in field.options %}
<option {% if key == value %}selected="selected"{% endif %} value="{{ field.multiple ? text : key }}">{{ text|tu }}</option>
<option {% if key == value or (field.multiple and text in value) %}selected="selected"{% endif %} value="{{ field.multiple ? text : key }}">{{ text|tu }}</option>
{% endfor %}
</select>
</div>