Form Field Validation Rules

  • Updated

You can assign a variety of validation rules to your form's input fields in the Form Builder. Validation rules require users to enter specific responses or values when filling in a form field. Your choice of validation will vary depending on the type of information you need to collect in each field.

Add Form Validation Rules to a Field

To add or edit form validation rules, open your form in the Form Builder and go to the Design tab at the top of the page.

Screen_Shot_2021-12-27_at_4.52.34_PM.png

Click on an input field in your form to open the Edit Input Field panel:

Screen_Shot_2021-12-28_at_6.07.08_PM.png

From here, you can quickly make the field required, or you can create more advanced validation for the field values your input will accept.

Make a Field Required

This simply requires that the field is completed to submit the form.

To add this to a field, click the asterisk at the top right of the panel to create a basic Required validation rule.

Screen_Shot_2021-12-27_at_5.04.52_PM.png

Add Validation Rules for Accepted Field Values

Go to the Validation tab.

Screen_Shot_2021-12-27_at_4.58.05_PM.png

Click   to add a new validation rule:

Screen_Shot_2021-12-27_at_5.08.09_PM.png

Select a rule from the drop-down menu:

Screen_Shot_2021-12-27_at_5.09.47_PM.png

Users will receive an error message on the form if their responses don't meet the field's validation rules. Each validation rule includes a default error message, which you can also customize in the Validation tab.

After you've created a validation rule, click   again to apply additional validation rules for the same input field.

To remove a validation rule, hover over the rule and click  .

Available Validation Rules

Below, you'll find a list of all validation rules available in the Form Builder along with descriptions and examples of each:

Validation

Description

Example/Regex

Required

Field must have content

Cannot be empty

Match

Field content has to match another field in the form

Verify email has been typed correctly twice

Email

Must have valid email with @ and . 

test@domain.com

/^[a-zA-Z0-9]+([\w'._+-])*@[\w-]+\.[\w-.]{2,}$/

Non-Consumer Email

Does not allow consumer email domains, listed here 

Use email regex above, plus:

^.*@(?!163[.]com|aol[.]com|bellsouth[.]net|blueyonder[.]co[.][a-z]{2}|btconnect[.]com|charter[.]com|comcast[.]net|cox[.]net|earthlink[.]net|email[.]com|gmail[.]co.[a-z]{2}|gmail[.]com|hotmail[.]co[.][a-z]{2}|hotmail[.]com|juno[.]com|mail[.]com|mail[.]ru|mindspring[.]com|msn[.]com|ntlworld[.]com|orange[.]fr|rogers[.]com|outlook[.]com|sbcglobal[.]net|shaw[.]ca|sympatico[.]ca|telus[.]net|verizon[.]net|virgin[.]net|virginmedia[.]com|yahoo[.]ca|yahoo[.]co[.][a-z]{2}|yahoo[.]com|ymail[.]com|icloud[.]com|me[.]com|mac[.]com).*$

Non-Generic Email

Does not allow generic email domains, listed here

Use email regex above, plus:

/^(?!(abuse@|accounting@|accounts@|adm@|admin@|administration@|administrator@|admissions@|ads@|all@|answers@|anti-spam@|antispam@|asdf@|billing@|ceo@|comments@|compliance@|contact@|contactus@|customer@|customercare@|customerservice@|database@|decliend@|decline@|declined@|denied@|designer@|devnull@|director@|dns@|email@|employment@|enquiries@|everyone@|fbl@|feedback@|finance@|ftp@|general@|hello@|helpdesk@|home@|hostmaster@|hr@|info@|information@|inoc@|investorrelations@|ispfeedback@|ispsupport@|jobs@|lawyer@|lawyers@|legal@|list@|list-request@|mail@|mailbox@|mail-daemon@|maildaemon@|mail-deamon@|manager@|managers@|marketing@|me@|media@|mediarelations@|mkt@|news@|noc@|noreplies@|no-reply@|noreply@|noemail@|nospam@|nothanks@|null@|office@|operations@|orders@|phish@|phishing@|post@|postbox@|postmaster@|prepress@|president@|press@|privacy@|purchasing@|qwer@|qwert@|qwerty@|reception@|refuse@|refused@|registrar@|remove@|request@|reservations@|returns@|root@|sales@|secretary@|security@|service@|services@|shop@|spam@|staff@|studio@|subscribe@|support@|sysadmin@|tech@|undisclosed-recipients@|unsubscribe@|usenet@|users@|uucp@|web@|webmaster@|welcome@|www@)).*/i

URL

Field content needs to be a URL that begins with "https://"

https://www.domain.com

/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/

Phone US

Valid phone format for a 10 digit US phone number including +1 for country code

 

valid:
+1 555-555-5555

(555) 555-5555

causes error:
+12 555 -555-5555

555-155-5555 

/^(\+?1?)?(-?\s?\.?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?\s?\.?[2-9]([0-9]{2})\s?-?\.?\d{4}$/

Phone International

Valid phone format for a 7-15 digit international phone number including + (international prefix symbol)

/^\+(?:[0-9] ?){6,14}[0-9]$/

Phone US or International

Verify for either formatting

/(^(\+?1?)?(-?\s?\.?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?\s?\.?[2-9]([0-9]{2})\s?-?\.?\d{4}$)|(^\+(?:[0-9] ?){6,14}[0-9]$)/

Numeric

Field input must be a number

/^\d+$/

Alphanumeric

Field input must include uppercase letters, lowercase letters, numbers, but no symbols

/^[a-zA-Z0-9]*$/

Minimum Length

Sets minimum number of characters in the field

 

Maximum Length

Sets maximum number of characters in the field

 

Custom

Match a specific word, phrase, or code with custom regex

 

 

Was this article helpful?

Have more questions? Submit a request