forked from areeburrub/flask-contacts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.py
More file actions
10 lines (8 loc) · 671 Bytes
/
forms.py
File metadata and controls
10 lines (8 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired, Email, Length
class ContactForm(FlaskForm):
name = StringField('Name', validators=[DataRequired(), Length(min=-1, max=80, message='You cannot have more than 80 characters')])
surname = StringField('Surname', validators=[Length(min=-1, max=100, message='You cannot have more than 100 characters')])
email = StringField('E-Mail', validators=[Email(), Length(min=-1, max=200, message='You cannot have more than 200 characters')])
phone = StringField('Phone', validators=[Length(min=-1, max=20, message='You cannot have more than 20 characters')])