Fixed problem with preselected values
This commit is contained in:
parent
473c2a4f5b
commit
529f9a6c64
|
@ -35,13 +35,13 @@
|
||||||
{% if field.type == 'SelectField' %}
|
{% if field.type == 'SelectField' %}
|
||||||
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control">
|
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control">
|
||||||
{% for choice in field.choices %}
|
{% for choice in field.choices %}
|
||||||
<option value="{{ choice[0] }}">{{ choice[1] }}</option>
|
<option value="{{ choice[0] }}" {% if choice[0] == field.default %}selected="selected"{%endif%}>{{ choice[1] }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
{% elif field.type == 'SelectMultipleField' %}
|
{% elif field.type == 'SelectMultipleField' %}
|
||||||
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control" multiple="multiple">
|
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control" multiple="multiple">
|
||||||
{% for choice in field.choices %}
|
{% for choice in field.choices %}
|
||||||
<option value="{{ choice[0] }}">{{ choice[1] }}</option>
|
<option value="{{ choice[0] }}" {% if choice[0] in field.default %}selected="selected"{%endif%}>{{ choice[1] }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
{% elif field.type == 'BooleanField' %}
|
{% elif field.type == 'BooleanField' %}
|
||||||
|
|
Loading…
Reference in New Issue