Make questions required and validate answers
Make questions required in Foxcolab Forms, limit length, numbers, picks and dates, check answers against your own pattern, and write error messages that tell people how to fix them.
Updated 3 min read
In short
For form validation in Foxcolab Forms, select a question in the Build tab and turn on Required. Then set its answer rules, such as Min characters, Maximum, Min picks or No past dates, or a custom pattern such as \d{6} for a six-digit PIN code. Add a Custom error message under Advanced, and test it all with Preview before you publish.
Key takeaways
- Select a question and turn on Required. Select several questions to make them all required at once.
- Each question type has its own rules, such as Min characters, Maximum, Max picks or No past dates.
- Custom pattern (regular expression) checks short answers against a pattern that must match the whole answer.
- A Custom error message replaces every error for that question, so write one that covers a blank answer too.
- Questions that logic hides are never checked, so a hidden required question can't block anyone.
Last reviewed 3 December 2026
Form validation in Foxcolab Forms starts with two settings on each question: Required, so it can't be skipped, and answer rules, so what comes back is in a shape you can use. A respondent who breaks a rule sees a message under the question and fixes it before the form will move on or submit.
Make a question required#
Select the question
In the Build tab, click the question on the form. Its settings open in the panel on the right.
Turn on Required
Switch on Required at the top of the panel. Respondents see that the question is required.
Test it
Click Preview at the top and try to submit without answering. You should see "This question requires an answer."
To change several questions at once, Ctrl-click (⌘-click on a Mac) each one, or click the first and Shift-click the last. The panel shows how many you've selected and how many are already required. Switch Required on or off for all of them.
A few things to know:
- Questions that logic hides are never checked, so a required question someone can't see won't stop them.
- To make a question required only in some cases, use the Require action in the Logic tab. See Use form logic, calculations and multiple endings.
- For a Consent question, Required means people must tick the box to submit.
- For a Matrix question, also switch on Every row must be answered if one answer for the whole grid isn't enough.
Set answer rules#
Each question type has its own rules in the panel:
| Question type | Rules |
|---|---|
| Short answer, Long answer | Min characters, Max characters |
| Short answer | Allowed characters: Anything, Letters only, Letters and numbers or Custom pattern (regular expression) |
| Email, Website | Checked automatically for a real-looking address |
| Phone | Must include a country code |
| Number, Amount | Minimum, Maximum, Decimal places |
| Checkboxes, Multi-select dropdown, Picture choice with several picks | Min picks, Max picks |
| Date, Date & time, Date range | Earliest, Latest, No past dates, No future dates, Days that can’t be picked |
Set Decimal places to 0 for whole numbers, such as a head count. For a booking form, combine No past dates with Sat and Sun under Days that can’t be picked.
Check answers against a pattern#
Choose Allowed characters → Custom pattern (regular expression) on a Short answer, then type the pattern. The pattern must match the whole answer. Forms adds the start and end markers for you, so you don't need ^ and $.
| To accept | Pattern | Accepts | Rejects |
|---|---|---|---|
| A six-digit Indian PIN code | \d{6} | 560001 | 56001, 5600 01 |
| An order number like AB1234 | [A-Z]{2}\d{4} | AB1234 | ab1234, AB123 |
| The same, in any case | [A-Za-z]{2}\d{4} | ab1234 | AB-1234 |
| An employee ID | EMP-\d{4} | EMP-0042 | EMP42 |
| A work email at one domain | [^@\s]+@example\.com | asha@example.com | asha@gmail.com |
India Post asks for a "6-digit PIN code" (India Post). For the pattern syntax, see MDN's guide to regular expressions.
If the pattern has a mistake, the panel shows "The custom pattern is not a valid regular expression." and the rule isn't used until you fix it. Stick to character classes, ranges, counts such as {6}, and alternatives with |. In Standard forms, Foxcolab checks answers again when they arrive, and that check doesn't understand look-aheads or backreferences (RE2 syntax). Patterns that use them are checked only in the respondent's browser.
Write a clearer error message#
Without a message of your own, respondents see the built-in one, such as "This answer isn't in the expected format." To tell them exactly what you want, open Advanced in the question's panel and fill in Custom error message.
Your message replaces every error for that question, including the one for a blank required answer. Write one sentence that works for both, such as "Enter your 6-digit PIN code, for example 560001." If your form has translations, translate the message too. See Customize form themes, layouts and translations.
Where answers are checked#
| Encrypted form | Standard form | |
|---|---|---|
| In the respondent's browser, before sending | Yes | Yes |
| By Foxcolab's servers, when the response arrives | No. The answers are encrypted, so Foxcolab can't read them | Yes |
In a multi-page form, Next checks the current page before moving on. Every visible question is checked again when the respondent submits. Rules guide honest respondents. If a value must be exact, such as an ID you'll act on, check it when you review the response. Learn more in Encrypted vs Standard forms.
Related#
Frequently asked questions
How do I make every question in a form required?
In the Build tab, click the first question, then Shift-click the last one to select them all. The panel shows how many are selected. Turn on Required.
Can a question be required only for some people?
Yes. In the Logic tab, add a rule with the Require action. The question is required only while the rule's condition is true. See Use form logic, calculations and multiple endings.
Can I limit an Email question to my company's domain?
Email questions check that the address is well formed, but patterns only work on Short answer questions. Use a Short answer with the custom pattern [^@\s]+@example\.com, replacing example.com with your domain, and a custom error message.
Are answers in encrypted forms still checked?
Yes, in the respondent's browser before the answers are encrypted and sent. Foxcolab can't read encrypted answers, so its servers check only Standard forms again when a response arrives.
Did this answer your question?
One click, no account needed.
Still need help?
Our support team can take it from here.