Text, number, date and time questions
Short and long text, email, website, phone, number, date and time, plus validation rules, custom error messages and the unique-answer option.
The types
| Type | What it collects | Limit or check |
|---|---|---|
| Short text | A single line | Up to 500 characters |
| Long text | Several lines | Up to 10,000 characters |
| An email address | Must look like name@example.com, up to 254 characters | |
| Website | A web address | A bare domain such as example.com is saved as https://example.com. Up to 2,000 characters |
| Phone | A phone number | Digits with an optional +, spaces, brackets, dots and hyphens; 6 to 15 digits. The error message asks for a country code |
| Number | A number | Whole or decimal. A comma decimal separator such as 12,5 is read as 12.5 |
| Date | A date | Stored as YYYY-MM-DD |
| Time | A time of day | Stored as HH:MM on a 24-hour clock |
All of these checks run on the server as well as in the browser, so a respondent cannot bypass them by editing the page.
Text is cleaned before it is stored: control characters are removed, and in short-text types runs of whitespace are collapsed to one space.
Settings on the card and in the panel
Select a question to see its settings panel on the right.
- Required is on the card and in the panel under Basics.
- Placeholder shows a hint inside the field (up to 120 characters). It is offered for short text, long text, email, website, phone and number.
- Help text appears under the question and accepts light Markdown.
- For a Date question, Allowed dates has Earliest and Latest. A date outside the range is refused with a message that starts "Pick a date on or after" (or "on or before", or "between") and names the limit.
Validation rules
Under Validation in the panel you choose a kind of rule, then an operator.
| Kind | Operators | Available on |
|---|---|---|
| Number | Greater than, Greater than or equal to, Less than, Less than or equal to, Equal to, Not equal to, Between, Not between, Is a number, Is a whole number | Number and Short text |
| Text | Contains, Does not contain, Is an email address, Is a web address | Short text, Long text, Website and Phone |
| Length | Maximum characters, Minimum characters | Every type above |
| Pattern | Matches pattern, Does not match pattern | Every type above |
For the operators that need a value, a field appears next to the operator, and Between and Not between take two values. Error message is what the respondent sees under the answer. Leave it empty and Formwork writes a specific default, for instance "Enter a number from 1 to 10."
A pattern is a regular expression written without delimiters, up to 200 characters, for example ^[A-Z]{2}\d{6}$ for two capitals and six digits. Patterns are checked against at most the first 2,000 characters of an answer. If a pattern cannot be compiled, the rule is skipped rather than blocking every submission.
Answer must be unique
Under the validation settings, Answer must be unique rejects a value that someone has already submitted. Use it for things like a membership number or a username. Matching ignores case and extra spaces, and only submitted responses count, so an unfinished draft does not reserve a value. The respondent sees "That answer has already been used. Try a different one."
Text answers in quizzes
Text questions can carry an answer key of Accepted answers, one per line, and number-like questions use Correct value with Tolerance. See Building a quiz.
Plans
All types on this page are available on every plan. Types that need a paid plan are described in Choices, ratings and grids and Uploads, signatures, addresses and layout blocks.
Updated Sep 30, 2026