Complete the code to import the correct form field type for a text input in Flask-WTF.
from flask_wtf import FlaskForm from wtforms import [1] class MyForm(FlaskForm): name = [1]('Name')
The StringField is used for text input fields in Flask-WTF forms.
Complete the code to add a password input field to the form.
from flask_wtf import FlaskForm from wtforms import StringField, [1] class LoginForm(FlaskForm): username = StringField('Username') password = [1]('Password')
The PasswordField is used for password inputs, hiding the text as the user types.
Fix the error in the code by choosing the correct field type for a checkbox.
from flask_wtf import FlaskForm from wtforms import StringField, [1] class SubscribeForm(FlaskForm): subscribe = [1]('Subscribe to newsletter')
The BooleanField is used for checkboxes in Flask-WTF forms.
Fill both blanks to create a form with a text area and a date input field.
from flask_wtf import FlaskForm from wtforms import [1], [2] class FeedbackForm(FlaskForm): comments = [1]('Comments') visit_date = [2]('Date of Visit')
TextAreaField is for multi-line text input, and DateField is for date inputs.
Fill all three blanks to define a form with an email, integer, and checkbox field.
from flask_wtf import FlaskForm from wtforms import [1], [2], [3] class RegistrationForm(FlaskForm): email = [1]('Email') age = [2]('Age') agree_terms = [3]('Agree to Terms')
EmailField validates email input, IntegerField accepts numbers, and BooleanField is for checkboxes.