Validation rules are a powerful way of checking for registration conditions and taking action. A broad selection of rules let you enforce specific rules and policies with great precision.
In general, validation rules are a more advanced feature most commonly used for:
- Enforcing race compliance fees
- Requiring valid membership or preventing non-members from registering
- Checking race transponder is on file
- Checking the vehicle make for marque-specific events
- Taking action based on the number of packages ordered
- Checking for valid answers to questions about age, dates or numbers
Validation rules can take one (or more) of the following actions:
- Show Error - display an error message and stop the registration
- Require - the target element must be selected/answered
- Unavailable - the target element may not be picked/answered
Require and Show Error account for nearly all of the actions used on forms.
MORE AUTOMATION WITH VALIDATION RULES
We recorded a webinar just about validation rules with examples for nearly all event types. Become a pro and watch it now.
Identifying Validation Rules
Validation rules are identified on the form layout with a red push-pin icon as in the following screen shot:
For each validation rule, an additional push-pin will be displayed. It's perfectly reasonable and common to have more than one rule on an element. Assigners will often check for both a compliance fee and a transponder.
To add a validation rule, first select any element in the form layout. In the right pane will appear the common form layout options plus a button at the bottom to "Add Rule".
Select the appropriate rule and, if required, enter a value into the adjacent field. For each rule, one or more actions may take place. It is most common to have one action per rule but there are scenarios where more than one action makes sense (like for a double race entry where a compliance fee for each race should be required).
Each action, added by clicking the "Add Action" button, is intended to read like an English sentence:
If <rule> is <true|false>, then <show an error|require something|make something unavailable>
Optionally, specify a custom error message and/or the element that is required. The "Require" and "Make Unavailable" actions will pop open a box to select a target element from the registration form.
Be sure to click save when you have made your changes. This also includes after deleting an action or rule.
When selecting a target element for Require or Make Unavailable, the only limitation is that you may not create an endless loop by picking the same element for which you are creating the validation rule.
Validation rules generally take action based upon the value of the element they are attached to. Here's the value we check for each type:
- Packages - the quantity selected (numeric)
- Question - the answer entered (0/1, text string, number, money or date)
- Assigner - must specifically validate against the class, modifier, group or vehicle
- Co-Driver Picker - empty or blank
- Groups - no value to validate against
- Branches - 0 = unchecked, 1 = checked
- Text Blocks - no value and cannot be used with validation rules
Certain rules, like "Membership is valid", are not type-specific and so can be attached to nearly any item in the form layout. Others, like "Class In List" only make sense in the context of an Assigner which collects vehicle class.
- Class is in list
- e.g. Require spec tire/fuel purchases (karting)
- e.g. Require compliance fees (racing)
- e.g. Show error if not a valid class (racing)
- Group is in list
- e.g. Require novice run group to pay for an instructor
- e.g. Require volunteers to answer a task/specialty question
- e.g. Show error when one group is full w/o inventory limits
- Transponder number is valid
- e.g. Require a rental transponder
- e.g. Show error until vehicle profile is updated
- Modifier is in list
- e.g. Require additional fee for double-point classification
- Modifier is empty
- e.g. Force selection of a class modifier/PAX
- Class is selected + Modifier is not in mapping list
- e.g. Limit which modifiers/PAX are allowed for specific classes
- e.g. SS1:S1,S2,S3,S4 - Class SS1 requires Modifier/PAX S1-S4
- e.g. N,P:* - require Novice/Pro to pick a class modifier/PAX
- Class in list does not allow a Modifier
- e.g. P,S,T,N - if false, show error to force selecting a modifier/PAX
- e.g. SS,AS,BS,CS... - if true, show error to prevent selecting a modifier/PAX
- Vehicle make is in list
- e.g. Show error if car is not a valid marque (e.g., Porsche only)
- Vehicle model is in list
e.g. Show error if model is not valid (e.g., 911 only)
- Vehicle year is in list
- e.g. Show error if year is not valid (car shows, concours)
- e.g. Require inspection fee if vehicle is certain age
- Vehicle color is empty
- e.g. Show error until vehicle profile is updated with color
- Engine displacement is empty
- e.g. Show error until vehicle profile is updated with engine displacement
- Log book number is empty
- e.g. Show error until vehicle profile is updated with logbook number
- Official weight is empty
- e.g. Show error until vehicle profile is updated with official weight
- GCR/CCR/Rules page number is empty
- e.g. Show error until vehicle profile is updated with rulebook page number
- Tire brand is empty
- e.g. Show error until vehicle profile is updated with tire brand
- Front/Rear Track is empty
- e.g. Show error until vehicle profile is updated with front/rear track
- VIN number is empty
- e.g. Show error until vehicle profile is updated with VIN
- Membership is valid during registration
- e.g. Show error to non-members as of today
- e.g. Require non-members to buy a membership
- e.g. Require valid members to choose a discounted fee
- Membership in local chapter/region/club is valid during registration
- e.g. Check membership in region/chapter as of today
- e.g. Give local members early access to register
- Membership is valid at start of event
- e.g. Show error to non-members as of the event start date
- Membership is valid in local chapter/region/club at start of event
- e.g. Check membership in region/chapter as of the event start date
- License in list validates (specified as program:type)
- e.g. Verify competition and specialty licenses (SCCA-specific)
- Value is empty
- e.g. Prevent another selection when a field is left blank
- e.g. Require another question/fee if field is not blank
- Value is in list (case-insensitive)
- e.g. Show error if invalid secret answer/promo code is entered
- e.g. Make special options unavailable without a valid answer
- Value is equal to this number
- e.g. Require answer to a question based on package quantity
- e.g. Force acknowledgement of yes/no questions
- Value is greater than this number
- e.g. Require or show error when numerical answer is greater than value
- Value is less than this number
- e.g. Require or show error when numerical answer is less than value
- Length is equal to this number
- e.g. Show error when answer length is equal to this number of characters
- Length is greater than this number
- e.g. Show error when answer length is greater than this number of characters
- Length is less than this number
- e.g. Show error when answer length is less than this number of characters
- Value matches the regular expression [ADVANCED]
- e.g. Show error if answer does not pass complex validation
Autocross/Solo Indexed Class Validation
The first rule above is Class is selected + Modifier is not in mapping list. This allows you to specify one or more classes followed by one or more modifiers that must be provided to satisfy the rule. Some examples:
- "P:*" would require any modifier/PAX for the "P" (Pro) class. The asterisk is a special character meaning "any". Only an empty value will fail this rule.
- "P:AS,BS,CS" would require a modifier/PAX of AS, BS or CS if the attendee selects the "P" (Pro) class. Any other value, including an empty value, will fail this rule.
- "N,L:AS,BS,CS,DS" would require Novice and Ladies classes to select a modifier of AS, BS, CS or DS. Any other value, including an empty value, will fail this rule.
The second rule above is Class in list does not allow a Modifier. This restricts certain classes from selecting a modifier/PAX for when it is not allowed. Some examples:
- "AS,BS,CS,DS" would prevent attendees who choose AS, BS, CS or DS as their class from choosing any modifier. This can be used to prevent non-indexed classes from choosing an index.
Finally, a third rule (not shown above) is Modifier is empty. This rule lets you require the attendee selects a modifier for a given assigner.
For more examples of validation rules in action, take a look at our Event Recipes which give real-world uses for each type.
It is possible (but rare) for a validation rule (either Require or Make Unavailable) to be created without selecting an element to act against (the "target"). When this happens, the registration form will display a message like:
To correct this, open the Form Builder and look at the validation rules (the red push pins), and you will find one with either a "Require" or "Make Unavailable" action, which does not have the target picked. Click the "pick" button like in this screenshot:
That will open a small window allowing you to select which form element should be enforced by the rule. Save it and your form will be good to go.
If you do have one of these, we recommend checking all of your validation rules in case this same issue exists elsewhere.