0
0
Flaskframework~5 mins

Form field types in Flask - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a StringField in Flask-WTF forms?
A StringField is a form field used to accept short text input from the user, like names or titles.
Click to reveal answer
beginner
How does a PasswordField differ from a StringField?
A PasswordField hides the input characters for privacy, typically used for passwords, while StringField shows the text as typed.
Click to reveal answer
beginner
What is the purpose of a BooleanField in Flask forms?
A BooleanField represents a checkbox that can be either checked (True) or unchecked (False).
Click to reveal answer
beginner
Explain the use of SelectField in Flask forms.
SelectField lets users pick one option from a dropdown list of choices.
Click to reveal answer
beginner
What kind of input does a TextAreaField accept?
TextAreaField accepts multi-line text input, useful for comments or messages.
Click to reveal answer
Which Flask-WTF field type is best for a user to enter their email address?
AStringField
BBooleanField
CPasswordField
DSelectField
Which field type hides the input characters as you type?
ATextAreaField
BPasswordField
CBooleanField
DStringField
If you want users to select one option from a list, which field should you use?
APasswordField
BBooleanField
CStringField
DSelectField
Which field type is best for a user to write a long message?
ASelectField
BBooleanField
CTextAreaField
DStringField
What does a BooleanField represent in a form?
AA checkbox
BA text input
CA dropdown list
DA password input
List and describe five common Flask-WTF form field types and their typical uses.
Think about different ways users enter data in forms.
You got /5 concepts.
    Explain when you would use a SelectField instead of a StringField in a Flask form.
    Consider user choices and input control.
    You got /4 concepts.