How can I add my own custom validation rules to booking form fields
You should include validation rules on your booking form fields to ensure you collect the best quality data possible. Read about the standard validation rules included out of the box with EventHQ here.
You may wish to add your own validation rules to ensure data quality. For example if you require attendees claiming discounted "member only" tickets enter their membership number, you could add a validation rule that checks the membership number looks valid.
Enter your validation rule details
ImportantCustom validation rules require a degree of knowledge about regular expressions. Some references are provided within EventHQ, but if you are in any doubt, please contact support who will be very happy to help build your regular expression
Describe the validation rule
The name and description are for internal use only and will not be seen by attendees. The error message is the text you want shown to attendees if the validation rule is triggered. Your error message should describe the problem in sufficient detail for the attendee to know how to fix the error. For example "your membership number is wrong, please try again" is not very helpful whereas "your membership number format is wrong, please ensure it starts with two uppercase letters, then a hyphen and then six digits" is much better.
Enter the regular expression to use for validation
- Pattern to match should be a full regular expression including the delimiters and any flags like i or g
- To help test your pattern works, please enter an example which matches your regular expression in the matching example field
- To help test your pattern works, please enter an example which does not match your regular expression in the matching example field
Click the "save changes" button to save your new validation rule
Your new rule will be listed in the validation rules section. You can create as many validation rules as you wish.