title: Unable to get value selected in python from a dropdown using Flask
body: <p>This question could be a duplicate but I have checked all the answers of such related questions and I haven't been able to solve it.</p>
  
  <p>I am trying to get the value from a dropdown menu which consists of numbers. Then I want to compare the numbers with a value and display a text based on the comparison.</p>
  
  <p>Eg </p>
  
  <pre><code>if value_selected_from_dropdown &gt;3
   display text
  </code></pre>
  
  <p>I am unable to get the text to display or even print the value of the option selected.</p>
  
  <p>Here is the python file, <code>web_plants.py</code></p>
  
  <pre><code>from flask import Flask, render_template,request, redirect, url_for
  
  app = Flask(__name__)
  
  def template(title = "HELLO!", text = ""):
      templateDate = {
          'text' : text
          }
      return templateDate
  
  @app.route("/threshold", methods=['POST'])
  def threshold():
          tvalue= (request.form.get['tvalue']) #get value from dropdown
          msg= ""
          if tvalue&gt;3:
            msg= "rating above 3"
           templateData = template(text = msg) #display text using template()
          #templateData = template(text = tvalue) #tried to print the value selected
          return render_template('index.html', **templateData)
  
  if __name__ == "__main__":
      app.run(host='0.0.0.0', port=80, debug=True)
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  
  &lt;head&gt;
   &lt;link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='style.css')}}" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
   &lt;h2&gt; {{ text }} &lt;/h2&gt;
  &lt;form action= "{{ url_for('threshold') }}" method="post&gt;"
               &lt;p&gt;
               &lt;select name= 'tvalue'&gt;
                   &lt;option value="10"&gt;10&lt;/option&gt;
                   &lt;option value="11"&gt;11&lt;/option&gt;
                   &lt;option value="15"&gt;15&lt;/option&gt;
                   &lt;option value="2"&gt;2&lt;/option&gt;
                   &lt;option value="1"&gt;1&lt;/option&gt;
                &lt;/select&gt;
                &lt;/p&gt;
      &lt;/form&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>