<div class="dropdown">
<button class="dropbtn"><h2>Please select your device <i class="fa fa-caret-down"></i></h2> </button>
<div class="dropdown-content">
{% for n in range(devicesFiles|length) %}
<form action={{url_for("annotator")}} method='POST'>
<a name="deviceID"> {{devicesFiles[n]}} </a></form>
{% endfor %}
</div>
</div>
@app.route("/annotator/", methods=['POST'])
def annotator():
return render_template("annotator.html")
我希望能够在单击下拉菜单框之一并在帖子中发送name变量时转到url_for(“ annotator”)。也许有比使用标签更简单的方法。谢谢!
尝试这个:
<div class="dropdown">
<button class="dropbtn"><h2>Please select your device <i class="fa fa-caret-down"></i></h2> </button>
<div class="dropdown-content">
<form action={{url_for("annotator")}} method='POST' id='annotator'>
<select id='annotate_select' form='annotator'>
{% for n in range(devicesFiles|length) %}
<option value={{devicesFiles[n]}}>{{devicesFiles[n]}}</option>
{% endfor %}
</select>
</form>
</div>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句