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 (rule name in bold) along with descriptions and examples:

  • Required
    Field must have content.
    Example: Cannot be empty.
  • Match
    Field content has to match another field in the Form.
    Example: Verify email has been typed correctly twice.
  • Email
    Must have valid email with @ and . 
    Example: test@domain.com
    Regex:
    /^[a-zA-Z0-9]+([\w'._+-])*@[\w-]+\.[\w-.]{2,}$/
  • Non-Consumer Email
    Does not allow consumer email domains.
    Examples listed here.
    Regex: 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 consumer email domains.
    Examples listed here.
    Regex: 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://"
    Example: https://www.domain.com
    Regex:
    /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/
  • Phone US
    Valid phone Format for a 10-digit US phone number including +1 for country code.
    Examples: 

    Valid:
    +1 555-555-5555
    (555) 555-5555

    Causes error:
    +12 555 -555-5555
    555-155-5555 

    Regex:
    /^(\+?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).
    Examples: 

    Valid:
    +1 1234 567890

    Causes error:
    01234 567890

    Regex:
    /^\+(?:[0-9] ?){6,14}[0-9]$/
  • Phone US or International
    Verify for either Formatting.
    Examples as above.
    Regex:
    /(^(\+?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.
    Regex:
    /^\d+$/
  • Alphanumeric
    Field input must include uppercase letters, lowercase letters, numbers, but no symbols
    Regex:
    /^[a-zA-Z0-9]*$/
  • Minimum Length
    Sets the minimum number of characters in the field.
  • Maximum Length
    Sets the 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