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