title: How to make HTML table row clickable without JQuery?
body: <p>Using flask, I want to select a user from a table and then redirect the page with the id of the selected user. My code looks something like this:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form action="" method="POST"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Id&lt;/th&gt;
              &lt;th&gt;First Name&lt;/th&gt;
              &lt;th&gt;Last Name&lt;/th&gt;
          &lt;/tr&gt;
              {% for user in users %}
                  &lt;tr type="submit" name="action" value="{{user.user_id}}"&gt;
                      &lt;td&gt;{{user.user_id}}&lt;/td&gt;
                      &lt;td&gt;{{user.first_name}}&lt;/td&gt;
                      &lt;td&gt;{{user.last_name}}&lt;/td&gt;
                  &lt;/tr&gt;
              {% endfor %}
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Python:</p>
  
  <pre><code>def userSelect():
  if request.method == 'POST':
      return redirect(url_for('user', user=request.form['action']))
  return render_template('userSelect.html', users=user.query.all())
  </code></pre>
  
  <p>I have also tried using JQuery to make the post, but I am unsure how to then use the id in the page that I redirected to, and I can't redirect from flask after having made a post from JQuery:</p>
  
  <pre><code>$("table tr").on("click",function()
  {
      var selected = $("td:first", this).text();
      $.post("/user", {user_id: selected}, function(){
          window.location.href = "/user";
      });
  });
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Let's just say I want to display that id on the page I redirect to (something like this):</p>
  
  <pre><code>@app.route("/user")
  def user(user):
      return user
  </code></pre>