Form Field Validation Rules

  • Updated

Use validation rules to ensure that contacts enter the correct type of data in your Act-On forms, such as requiring a properly formatted email address or a five-digit ZIP code. This helps reduce submission errors and keeps your contact records clean.

Assign validation rules to your Form's input fields in the Form Builder. 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:

  1. 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
  2. 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 make the field required, or you can create more advanced validation for the field values your input will accept.

Make a Field Required

This requires that the field be completed to submit the Form.

  1. 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

  1. Go to the Validation tab:

    Screen_Shot_2021-12-27_at_4.58.05_PM.png
  2. Click to add a new validation rule:

    Screen_Shot_2021-12-27_at_5.08.09_PM.png
  3. Select a rule from the drop-down menu:

    Screen_Shot_2021-12-27_at_5.09.47_PM.png
  4. Under Error Messages, check the default error message for the validation rule is suitable & customize it if required. Users will receive this error message on the Form if their responses don't meet the field's validation rules.
  5. To create more validation rules for the same field, click again & repeat the steps above.
  6. To remove a validation rule, hover over the rule and click
  7. At the bottom right, click OK, & at the top right, Save your changes.
  8. Test your form to check that the validation works as expected. Learn more

Available Validation Rules

The validation rules available work well for most common field types. 

Custom Validation Rules
You can also create custom validation rules to match a specific word, phrase, or code with custom regex. See Custom Validation Rules.

These are the validation rules available in the Form Builder (rule name in bold), along with descriptions and examples:

  • Required
    The 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 a 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
    See Custom Validation Rules.

Tips & Best Practices

  • Use the built-in options when possible — they’re easier to maintain.
  • Always include a clear error message for your users.
  • Test your form to check that the validation works as expected. Learn more

Was this article helpful?

Have more questions? Submit a request