Get selected text from a form using wtforms SelectField

后端 未结 5 1112
别跟我提以往
别跟我提以往 2020-12-17 21:02

This is a question upon the use of wtforms SelectField.

Once the form submitted, I wish to extract selected text.

I have the following form:

5条回答
  •  一个人的身影
    2020-12-17 21:40

    If you don't need the choice indexes, is much more simpler:

    class TestForm(Form):
      hour = SelectField(u'Hour', choices=[('8am', '8am'), ('10am', '10am') ])
    

提交回复
热议问题