selectfield flask wtf
HOUR_CHOICES = [('1', '8am'), ('2', '10am')]
class TestForm(Form):
hour = SelectField(u'Hour', choices=HOUR_CHOICES)
selectfield flask wtf
HOUR_CHOICES = [('1', '8am'), ('2', '10am')]
class TestForm(Form):
hour = SelectField(u'Hour', choices=HOUR_CHOICES)
flask form
class PostForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
content = TextAreaField('Content', validators=[DataRequired()])
validators=[DataRequired(), Length(min=2, max=50)])
submit = SubmitField('Post')
flask form options
{% macro render_field(field) %}
<dt>{{ field.label }}
<dd>{{ field(**kwargs)|safe }}
{% if field.errors %}
<ul class=errors>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</dd>
{% endmacro %}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us