title: How do I access values for bootstrap-slider (using flask)
body: <p>I'm using the following javascript bootstrap-slider (example 6):</p>
  
  <pre><code>https://github.com/seiyria/bootstrap-slider
  </code></pre>
  
  <p>I can't seem to extract the selected values from the POST data.</p>
  
  <p>Here is the form that includes the slider in the html page:</p>
  
  <pre><code>&lt;form action="{{ url_for('filter') }}" method=post&gt;
          &lt;div class='slider-example'&gt;
                  &lt;h4&gt;Date-Time Range&lt;/h4&gt;
              &lt;div class="well"&gt;
                  &lt;p id="basicExample"&gt;
                      &lt;!-- Date/time range form; requires js library at bottom --&gt;
                      &lt;input type="test" placeholder="Start Date" class="date start" name="startdate" value="{{ request.form.startdate }}"&gt;
                      &lt;input type="test" placeholder="Start Time" class="time start" name="starttime" value="{{ request.form.starttime }}"&gt;  to  
                      &lt;input type="test" placeholder="End Date" class="date end" name="enddate" value="{{ request.form.enddate }}"&gt;
                      &lt;input type="test" placeholder="End Time" class="time end" name="endtime" value="{{ request.form.endtime }}"&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
                  &lt;hr&gt;
  
                  &lt;h4&gt;HDOP Range&lt;/h4&gt;
  
              &lt;div class="well"&gt;
  
                  &lt;input id="ex16b" type="text" data-slider-min="{{hdopmin}}" data-slider-max="{{hdopmax}}" data-slider-step=".01" 
                  data-slider-ticks="[{{hdopmin}}, {{hdopmax}}]" data-slider-ticks-snap-bounds="1" data-slider-ticks-labels="['{{hdopmin}}', '{{hdopmax}}']" /&gt;
  
              &lt;/div&gt;
  
                  {{ form.submit }}
  
  
          &lt;/form&gt;
  </code></pre>
  
  <p>The javascript for this slider:</p>
  
  <pre><code>&lt;script type='text/javascript' src="static/js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src="static/js/bootstrap-slider.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
      $(document).ready(function() {
  
          /* Example 6 */
          $("#ex6").slider();
          $("#ex6").on('slide', function(slideEvt) {
              $("#ex6SliderVal").text(slideEvt.value);
          });
          /* Example 16 */
  
          $("#ex16b").slider({
              min  : 0,
              max  : 10,
              value: [ 0, 10 ],
              focus: true
          });
  
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm trying to access the values of the slider's two positions set by the user. I'm dynamically setting the min and max values of the range using {{hdopmin}} and {{hdopmax}}.</p>
  
  <p>My app.py view function:</p>
  
  <pre><code>@app.route('/filter', methods=['GET', 'POST'])
  def filter():
      conn = sqlite3.connect(database)
      c = conn.cursor()
  
      form = FilterForm()
  
      mx = c.execute('select max(hdop) from points where hdop is not "" limit 1')
      hdopmax = mx.fetchall()[0][0]
  
      mn = c.execute('select min(hdop) from points where hdop is not "" limit 1')
      hdopmin = mn.fetchall()[0][0]
  
  
      if request.method == 'POST':
          print request.form
          return 'Form posted.'
  
      elif request.method == 'GET':
          return render_template('filter.html', form=form, hdopmax=hdopmax, hdopmin=hdopmin)
  </code></pre>
  
  <p>When I fill out this form and submit it, none of the slider value data is included. Below is the output from 'print request.form'. As you can see it includes all of the date time information, but none of the range selected values.</p>
  
  <pre><code>ImmutableMultiDict([('startdate', u'2015-10-14'), ('endtime', u'17:30:00'), ('enddate', u'2015-10-23'), ('starttime', u'17:30:00'), ('submit', u'Submit')])
  </code></pre>
  
  <p>Am I missing a value in the bootstrap-slider form or something? I can't find anything on the homepage that mentions actually making use of the slider values.</p>
  
  <p>Thanks</p>