Difference between revisions of "Implementing Select field with Flask"

From PeformIQ Upgrade
Jump to navigation Jump to search
 
Line 5: Line 5:


<pre>
<pre>
<td>
<select name="State" class="inputSelect">
<select name="State" class="inputSelect">
{% for state in ctx.State_options %}
{% for state in ctx.State_options %}
Line 12: Line 10:
{% endfor %}
{% endfor %}
</select>
</select>
</td>
</pre>
</pre>




[[Category:Flask]]
[[Category:Flask]]

Latest revision as of 12:48, 26 June 2017

See:

<select name="State" class="inputSelect">
{% for state in ctx.State_options %}
 <option value="{{state}}" {{'selected' if ctx.State == state else ''}}>{{state}}</option>
{% endfor %}
</select>