Editor Form Validation | GetAccept Help Center

Editor Form Validation

How to Guide Recipients to Enter Well-Formatted Data Using Regular Expressions

November 26, 2024

Introduction

When creating forms in GetAccept, it’s important to guide recipients in entering well-formatted data. Consider using specialized input fields, such as dates, emails, checkboxes, or option lists, which will automatically validate the data for you. If none of these input types meet your needs, and you require a free text field, this article will walk you through using regular expressions (RegEx) for validating the input.


Creating a New Field with RegEx

  1. Create an Editor Block: Start by creating an editor block where you want the text input field.

  2. Add a Text Input Field: Click the blue [ + ] symbol inside the block, scroll down, and select the Text input field from the Engagement elements list.

  3. Set Up Validation:

Note:


Setting Up Your RegEx Validation

The RegEx validation setup allows you to create customized validation rules for your text input fields. The modal includes fields for entering your RegEx pattern, custom error message, and a test area to validate your input.

The RegEx Field

This is where you input the regular expression that will validate the user’s input. The entered expression will be matched against the entire input. If the expression matches, the input will be considered valid. If it doesn’t match, the input will be flagged as invalid.

Common Regular Expressions

Here are some useful RegEx patterns that you can copy and paste directly into the field:


The Custom Error Field

This is where you enter the error message that will appear if the recipient or sender inputs invalid data. Make the message clear and instructive so users understand what they need to correct.

Example: If validating for an email address, the error message might read: _"Please enter a valid email address, e.g., example@domain.com."


The Test Field

Before saving your settings, test your regular expression in the test field. Enter various inputs to ensure the RegEx works as expected. Testing helps prevent invalid inputs from slipping through and ensures recipients can easily comply with the form’s requirements.


Using Minimum and Maximum Field Lengths

If you don't require RegEx validation but still need basic input control, you can set minimum and maximum character limits directly from the field settings:

Example: A phone number field might require a minimum of 10 characters and a maximum of 15.