# 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.')
      Python language logo

      Form with validation

      Python public recipes

      Flask form with validation

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.