Difference between revisions of "Implementing Select field with Flask"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) |
PeterHarding (talk | contribs) |
||
Line 5: | Line 5: | ||
<pre> | <pre> | ||
<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> | ||
</pre> | </pre> | ||
[[Category:Flask]] | [[Category:Flask]] |
Latest revision as of 13: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>