Difference between revisions of "Implementing Select field with Flask"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (Created page with " See: * http://stackoverflow.com/questions/24392501/how-to-use-selectfield-for-flask-and-retreive-multiple-values Category:Flask") |
PeterHarding (talk | contribs) |
||
Line 3: | Line 3: | ||
* http://stackoverflow.com/questions/24392501/how-to-use-selectfield-for-flask-and-retreive-multiple-values | * http://stackoverflow.com/questions/24392501/how-to-use-selectfield-for-flask-and-retreive-multiple-values | ||
<pre> | |||
<td> | |||
<select name="State" class="inputSelect"> | |||
{% for state in ctx.State_options %} | |||
<option value="{{state}}" {{'selected' if ctx.State == state else ''}}>{{state}}</option> | |||
{% endfor %} | |||
</select> | |||
</td> | |||
</pre> | |||
[[Category:Flask]] | [[Category:Flask]] |
Revision as of 13:47, 26 June 2017
See:
<td> <select name="State" class="inputSelect"> {% for state in ctx.State_options %} <option value="{{state}}" {{'selected' if ctx.State == state else ''}}>{{state}}</option> {% endfor %} </select> </td>