title: Request html label text from flask
body: <p>I develop a flask app that has a label in a html. The label text is inside a form and changed via javascript on user input. But if the form is submitted I call a flask route and want to get / request the label text. Request works with ranges or dropdown but it doesn't with the label for some reason. What am I missing? </p>
  
  <p>Here is what works:</p>
  
  <pre><code>@app.route("/estimator/", methods=['GET', 'POST'])
  def estimator():
      if request.method == 'POST':
          mmm_es.online = float(request.form['range_on'])
  </code></pre>
  
  <p>and what does not work:</p>
  
  <pre><code>@app.route("/estimator/", methods=['GET', 'POST'])
  def estimator():
      if request.method == 'POST':
          mean_sum = request.form['spend_per_month']
  </code></pre>
  
  <p>or</p>
  
  <pre><code>        mean_sum = request.form.get('spend_per_month')
  </code></pre>
  
  <p>I either get "none" as a value for mean_sum or a bad request page.</p>
  
  <p>The html looks something like this:</p>
  
  <pre><code>     &lt;div class="col-sm-4"&gt;
           &lt;label&gt; Spending gesamt: &lt;/label&gt;
           &lt;input type="text" id="sumofspending" size=4 value={{ gesamt_sum }}&gt; T€     &lt;/input&gt;
           Spending pro Monat: &lt;label style="font-weight:normal" id="spend_per_month" name="spend_per_month"&gt; {{ mean_sum }} T€ &lt;/label&gt;
       &lt;/div&gt;
       &lt;div class="col-sm-7"&gt;
          &lt;label&gt; Online: &lt;/label&gt;
          &lt;input type="range" name="range_on" min="0" max="10000" step="1" value="{{ online }}" id="range_online" onmousemove="update_from_rangetext(range_online)"/&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p>The full form is:</p>
  
  <pre><code>&lt;form  onsubmit="showloader()" action="/estimator/" method="POST" role="form" class="form-horizontal" style="display: inline;"&gt;
   &lt;div class="form-group"&gt;
       &lt;div class="row"&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;label for="sel1"&gt;Geschäftsbereich:&lt;/label&gt;
               &lt;select class="form-control" id="pg" name="pg" onchange="this.form.submit()"&gt;
                   {% for pg_feature in pg_features %}
                      &lt;option value="{{ pg_feature }}" {% if pg_feature==pg_select %} SELECTED {% endif %}&gt;{{ pg_feature }}&lt;/option&gt;
                   {% endfor %}
               &lt;/select&gt;
  
           &lt;/div&gt;
           &lt;div class="col-sm-3"&gt;
              &lt;label&gt; GWE jetzt (%): &lt;/label&gt; &lt;br&gt;
              &lt;input type="text" name="GWE_jetzt" style="width:40px" value="{{  gwe_jetzt  }}"&gt;
           &lt;/div&gt;
           &lt;div class="col-xs-12" style="height:20px;"&gt;&lt;/div&gt;
           &lt;!--div class="col-xs-12" style="height:25px;"&gt; &lt;label&gt; KPIs jetzt: &lt;/label&gt; &lt;/div--&gt;
  
           &lt;div class="col-sm-4"&gt;
               &lt;label&gt; Anfangsmonat: &lt;/label&gt;
               &lt;select class="form-control" id="start_month" name="start_month" onchange="update_spends_per_month()"&gt;
                   &lt;option value="Januar"&gt; Januar &lt;/option&gt;
                   &lt;option value="Februar"&gt; Februar &lt;/option&gt;
                   &lt;option value="März"&gt; März &lt;/option&gt;
                   &lt;option value="April"&gt; April &lt;/option&gt;
                   &lt;option value="Mai"&gt; Mai &lt;/option&gt;
                   &lt;option value="Juni"&gt; Juni &lt;/option&gt;
                   &lt;option value="Juli"&gt; Juli &lt;/option&gt;
                   &lt;option value="August"&gt; August &lt;/option&gt;
                   &lt;option value="September"&gt; September &lt;/option&gt;
                   &lt;option value="Oktober"&gt; Oktober &lt;/option&gt;
                   &lt;option value="November"&gt; November &lt;/option&gt;
                   &lt;option value="Dezember"&gt; Dezember &lt;/option&gt;
               &lt;/select&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;label&gt; Endmonat: &lt;/label&gt;
               &lt;select class="form-control" id="end_month" name="end_month" onchange="update_spends_per_month()"&gt;
                   &lt;option value="Januar"&gt; Januar &lt;/option&gt;
                   &lt;option value="Februar"&gt; Februar &lt;/option&gt;
                   &lt;option value="März"&gt; März &lt;/option&gt;
                   &lt;option value="April"&gt; April &lt;/option&gt;
                   &lt;option value="Mai"&gt; Mai &lt;/option&gt;
                   &lt;option value="Juni"&gt; Juni &lt;/option&gt;
                   &lt;option value="Juli"&gt; Juli &lt;/option&gt;
                   &lt;option value="August"&gt; August &lt;/option&gt;
                   &lt;option value="September"&gt; September &lt;/option&gt;
                   &lt;option value="Oktober"&gt; Oktober &lt;/option&gt;
                   &lt;option value="November"&gt; November &lt;/option&gt;
                   &lt;option value="Dezember"&gt; Dezember &lt;/option&gt;
               &lt;/select&gt;
           &lt;/div&gt;
           &lt;!--div class="col-sm-3"&gt;
              &lt;label&gt; GMB (%): &lt;/label&gt;
              &lt;!--input type="text" name="GMB_jetzt" style="width:40px" value="{{  gmb_jetzt  }}"--&gt;
              &lt;!--input type="text" name="GMB_jetzt" style="width:40px" value=0&gt;
           &lt;/div&gt;
            &lt;div class="col-sm-3"&gt;
              &lt;label&gt; KB (%): &lt;/label&gt;
              &lt;input type="text" name="KB_jetzt" style="width:40px" value=0&gt;
           &lt;/div--&gt;
           &lt;div class="col-xs-12" style="height:20px;"&gt;&lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;label&gt; Spending gesamt: &lt;/label&gt;
               &lt;input type="text" id="sumofspending" name="sumofspending" size=4 value={{ gesamt_sum }}&gt; T€     &lt;/input&gt;
               Spending pro Monat: &lt;label style="font-weight:normal" id="spend_per_month" name="spend_per_month"&gt; {{ mean_sum }} T€ &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-5"&gt;
               &lt;button type="button" size=1 onclick="update_from_total()"&gt; Gesamtspending prozentual auf genutzte Medien verteilen &lt;/button&gt;
           &lt;/div&gt;
           &lt;!--div class="col-sm-4"&gt;
               &lt;label&gt; In Prozent: &lt;/label&gt;
               &lt;input type="checkbox" name="inprozent" id="inpercent" checked&gt;
           &lt;/div--&gt;
           &lt;div class="col-xs-12" style="height:20px;"&gt;&lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
                &lt;input type="checkbox" name="gesamtprozent" value="gesamt" id="gesamtfest" {{ 'checked="checked"' if gesamt_checked else "" }} /&gt; Gesamt fest
                &lt;br&gt; &lt;/br&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
           &lt;/div&gt;
  
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; TV: &lt;/label&gt;
              &lt;input type="range" name="range_tv" min="0" max="10000" step="1" value="{{ tv }}" id="range_tv" onmousemove="update_from_rangetext(range_tv)"/&gt; &lt;/input&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_tv" size=1  onkeyup="update_from_rangetext(text_tv)" value="{{ tv }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_tv" size=1  onkeyup="update_from_rangetext(percent_tv)" value="33"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;!--div class="col-sm-2"&gt;
               &lt;label id="percent_tv"&gt; &lt;/label&gt; %
           &lt;/div--&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Online: &lt;/label&gt;
              &lt;input type="range" name="range_on" min="0" max="10000" step="1" value="{{ online }}" id="range_online" onmousemove="update_from_rangetext(range_online)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
              &lt;input type="text" id="text_online" size=1  onkeyup="update_from_rangetext(text_online)" value="{{ online }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_online" size=1  onkeyup="update_from_rangetext(percent_online)" value="33"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Publikumszeitschriften: &lt;/label&gt;
              &lt;input type="range" name="range_pz" min="0" max="10000" step="1" value="{{ pz }}"  id="range_pz" onmousemove="update_from_rangetext(range_pz)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_pz" size=1  onkeyup="update_from_rangetext(text_pz)" value="{{ pz }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_pz" size=1  onkeyup="update_from_rangetext(percent_pz)" value="33"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Radio: &lt;/label&gt;
              &lt;input type="range" name="range_radio" min="0" max="10000" step="1" value="{{ radio }}"   id="range_radio" onmousemove="update_from_rangetext(range_radio)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_radio" size=1  onkeyup="update_from_rangetext(text_radio)" value="{{ radio }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_radio" size=1  onkeyup="update_from_rangetext(percent_radio)" value="0"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Kino: &lt;/label&gt;
              &lt;input type="range" name="range_kino" min="0" max="10000" step="1" value="{{ kino }}" id="range_kino" onmousemove="update_from_rangetext(range_kino)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_kino" size=1  onkeyup="update_from_rangetext(text_kino)"  value="{{ kino }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_kino" size=1  onkeyup="update_from_rangetext(percent_kino)" value="0"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;!--div class="col-sm-7"&gt;
              &lt;label&gt; Mobile: &lt;/label&gt;
              &lt;input type="range" name="range_mobile" min="0" max="1000" step="1" value="{{ mobile }}" id="range_mobile" onmousemove="update_from_rangetext(range_mobile)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-2"&gt;
              &lt;input type="text" id="text_mobile" size=1&gt; &lt;/input&gt; &lt;label&gt; T€ &lt;/label&gt;
           &lt;/div--&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Zeitungen: &lt;/label&gt;
              &lt;input type="range" name="range_tz" min="0" max="10000" step="1" value="{{ tz }}" id="range_tz" onmousemove="update_from_rangetext(range_tz)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
              &lt;input type="text" id="text_tz" size=1  onkeyup="update_from_rangetext(text_tz)"  value="{{ tz }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_tz" size=1  onkeyup="update_from_rangetext(percent_tz)" value="0"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Plakat: &lt;/label&gt;
              &lt;input type="range" name="range_ooh" min="0" max="10000" step="1" value="{{ ooh }}" id="range_ooh" onmousemove="update_from_rangetext(range_ooh)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_ooh" size=1  onkeyup="update_from_rangetext(text_ooh)"  value="{{ ooh }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_ooh" size=1  onkeyup="update_from_rangetext(percent_ooh)" value="0"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-7"&gt;
              &lt;label&gt; Werbesendungen: &lt;/label&gt;
              &lt;input type="range" name="range_ws" min="0" max="10000" step="1" value="{{ ws }}" id="range_ws" onmousemove="update_from_rangetext(range_ws)"/&gt;
           &lt;/div&gt;
           &lt;div class="col-sm-4"&gt;
               &lt;input type="text" id="text_ws" size=1  onkeyup="update_from_rangetext(text_ws)"  value="{{ ws }}"&gt; &lt;/input&gt; &lt;label&gt; T€ - &lt;/label&gt;
               &lt;input type="text" id="percent_ws" size=1  onkeyup="update_from_rangetext(percent_ws)" value="0"&gt; &lt;/input&gt; &lt;label&gt; %  &lt;/label&gt;
           &lt;/div&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;button type="submit" class="btn btn-info btn-lg"&gt;Schätze KPI's &lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>