Table of Contents
Registration form data plays a crucial role in helping you collect key information about event registrants. Besides standard fields like First and Last Name and Email, you can also include other mandatory fields like Company Name, Job Title, Country, etc., to gather additional data about your registrants.
However, there might be situations where registrants fill in random characters like “-” or “*” in these fields instead of keying in the correct values. This is where Regular Expression Patterns come to your rescue.
Regular Expression Pattern (Regex)
Regex (Regular Expression) is a sequence of characters that is used for pattern matching within strings. You can use it to validate whether the text the user has entered in an input field on the registration form matches your parameters.
Example: Set up a regex pattern to check if the registrant has entered only alphabetic values for the Company Name field.
- Login to Goldcast Studio, select your preferred event and navigate to the Registration → Page & Form tab using the left sidebar.
- Click the Edit button in the Registration Form section to open the Registration Form Builder.
- Click the Edit icon next to your desired component, like the Company Name field.
- Navigate to the Validate tab and choose Blur in the Validate On dropdown. Select the Required checkbox.
- In the Regular Expression Pattern field, copy-paste this expression:
^[a-zA-Z]+$
This pattern ensures that only letters (both lower and uppercase) are allowed in the input for the component. If there are any other characters, the match will fail. The Submit button on the Registration Form will be enabled only when the user enters alphabets in the Company Name field.
- Use the Custom Error Message field to enter the error you want to display if the user enters a wrong input.
- Click Update and click Save.
Another example of using regex patterns is to limit registrations to certain email domains. To learn more, refer to our guide on Creating and Editing Registration Forms.