title: How to find value of HTML radio button in using Python and flask?
body: <p>So I've created the following form with radio buttons, that is submitted via "POST":</p>
  
  <pre><code>&lt;form style="margin: auto"&gt;
              &lt;label&gt;
                &lt;input type="radio" name="activity" value="0"/&gt;sedentary
              &lt;/label&gt;
              &lt;label&gt;
                &lt;input type="radio" name="activity" value="1"/&gt;lightly active (1-3 days a week)
              &lt;/label&gt;
              &lt;label&gt;
                &lt;input type="radio" name="activity" value="2"/&gt;moderately active (3-5 days a week)
              &lt;/label&gt;
              &lt;br&gt;
               &lt;label&gt;
                &lt;input type="radio" name="activity" value="3"/&gt;heavy exercise (6-7 days a week)
              &lt;/label&gt;
              &lt;label&gt;
                &lt;input type="radio" name="activity" value="4"/&gt;very heavy exercise (exercising twice a day or working physical job)
              &lt;/label&gt;
            &lt;/form&gt;
  </code></pre>
  
  <p>My problem is that I don't know how to access the results of this in my Python code. I'm able to access values submitted via text forms on the same page, so I don't think my POST is the issue (I'm using Flask, so request.form.get("field") does the trick there). Research shows that people have previously suggested "request.form['activity']", but this results in a 404 error; people have also suggested "request.form.get('activity','1'), but this just returns a value of '1' whether or not the radio button is even pressed.</p>
  
  <p>Any help would be appreciated!</p>