I want to pass the selected {{ exam[0] }}
to the show_exam_form
function.
However I could not do that.
Environment
Python 3.6.1
Flask==0.12.2
Jinja2==2.9.6
app.py
@app.route('/exam/<int:exam_id>', methods=['POST'])
def show_exam_form(exam_id):
print(exam_id)
html
<form action="{{ url_for('show_exam_form', exam_id=exam_id) }}" method='POST'>
<select name=exam_id>
{% for exam in exams %}
<option value="{{exam[0]}}">{{exam[1]}}</option>
{% endfor %}
</select>
How can I solve it?
Please let me know if you need more information to solve it.
Thank you!!!