Show db value as html selected option

This commit is contained in:
Diogo
2021-10-19 13:18:10 +01:00
parent 0170abb5c3
commit 50df1bb2f6
2 changed files with 8 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
<div class="form-label">{{ label }}</div>
<select class="form-select" name="{{ name }}" id="{{ id }}">
{% for option in options %}
<option value="{{ option[1] }}" {% if option[1] == value %}
<option value="{{ option[1] }}" {% if option[0] == value %}
selected
{% endif %} >{{ option[0] }}</option>
{% endfor %}