Form validation

Collect accurate information from your respondents by validating form inputs. Define validation rules using logic conditions, regular expressions or out-of-the-box validation rules.

What is form validation

Data validation in form building or simply form validation ensures that the responses matches certain predefined criteria before the form is submitted. This maintains the accuracy of the data and enhances security by avoiding the submission of incorrect, incomplete or harmful data.

Set a validation rule

Click on the question or field followed by its settings icon to open the right-hand panel. Open the Validation dropdown and choose a Validation pattern.
notion image

Validate with Regular Expressions

Choose Regex validate a form input with a regular expression, which definse a rule for the type of input you want to accept. See here for a list of popular regular expressions. Here are some examples:
Purpose
Regular expression
Whole numbers
^\d+$
Alphanumeric without space
^[a-zA-Z0-9]*$
Alphanumeric with space
^[a-zA-Z0-9 ]*$
URL
https?:\/\/(www\.)?[-a-zA-Z0-9@:%.\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%\+.~#()?&//=]*)
Decimal numbers
^\d*\.\d+$
Whole and decimal numbers
^\d*(\.\d+)?$
 
Copy and paste one of the regular expressions above into the Regex field. Test your form using the Preview mode!
notion image

Validate with logic

Choose the Condition validation pattern to validate a form input based on an arbitrary condition. Click Set conditional logic. For example, we only want to accept gmail or yahoo emails.
notion image

Validate text length

Use the min and max length validation rules to specify the accepted length of text inputs.
notion image
 

Custom error messages

Provide an Error message through the right-hand side settings to override the default warning message.
notion image

Testing validation logic

Go to Preview mode and click on the Next or Submit button. You’ll see a warning message appear if your inputs don’t match your validation rules.