title: Flask WTForms SelectField get currently selected item
body: <p>I am having difficulty getting the currently selected item in a WTForms page in a Flask app on submit. The form.tableselector.data value is always equal to 1 on submit, no matter which item in the SelectField is selected (and all choices have a unique table id from 1-10 of the form (1, 'table_name') where 1 is an integer. </p>
  
  <p>Here is current code:</p>
  
  <p>views.py</p>
  
  <pre><code>from flask import session
  
  def view(self):
      form = Tableset(request.form)
      if request.method == 'POST' and form.validate():
          #form.tableselector.data always returns 1 no matter which item is selected?
          session['table_id'] = form.tableselector.data
  </code></pre>
  
  <p>form.py</p>
  
  <pre><code>class MyBaseForm(Form):
      #see https://wtforms.readthedocs.io/en/latest/csrf.html
      class Meta:
          csrf = True
          csrf_class = SessionCSRF
          csrf_secret = app.config.get('SECRET_KEY')
  
          @property
          def csrf_context(self):
              return session
  
  class Tableset(MyBaseForm):
      tableselector = SelectField(label = 'Table', choices = [], coerce=int, id='select_table')
      submit = SubmitField('Submit')
  
      def validate(self):
          if len(self.tableselector.choices) == 0:
              return False
          return True
  </code></pre>
  
  <p>tableview.html</p>
  
  <pre><code>&lt;form role="form" action="{{ url_for('app.table_view') }}" method="post"&gt;
      {{ form.csrf_token }}
      &lt;div class="form-group"&gt;
      {{ form.tableselector.label }} 
      {{ form.tableselector }}
      &lt;/div&gt;
  </code></pre>
  
  <p>I note that on debug for the form the wtf Meta object csrf property is equal to True so I know CSRF is working.</p>