# custom validator
class FormName(FlaskForm):
answer = IntegerField('The Number')
submit = SubmitField()
def validate_answer(form, field):
if field.data != 42:
raise ValidationError('Must be 42.')
Form with validation
Flask form with validation
0 Comments
Add Comment
Log in to add a comment