Answer the question
In order to leave comments, you need to log in
How to display an invalid email notification?
Hello, I have an "email" field in my forms that is checked by the validator for "correctness". Everything works only "quietly" - but I would like if something went wrong (for example, they forgot to put the dog) - a notification was displayed - "put @" well, or something like that. Of course, this can be done as a separate function in the models with parsing the mail string and checking it for the necessary elements, but maybe these functions are already built into this validator and you shouldn’t fence the garden?
Thank you!
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired, Email
class RegistrationForm(FlaskForm):
email = StringField('Email: ',validators=[DataRequired(),Email()]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question