Contents |
Validation Rules
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 an advanced feature used by a minority of our customers. They are 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
Validation rules can take one (or more) of the following four actions:
- Required - the target element must be selected/answered
- Show Error - display an error message and stop the registration
- Unavailable - the target element may not be picked/answered
- Available - added for completeness
Required and Show Error account for nearly all of the actions used on forms.
Usage
- Identifying validation rules
- Adding rules
- Rule explanations
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.
Adding Rules
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". Clicking it presents a form like the following:
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 roughly like an English sentence:
If <above rule is true or false>, this action is <required|show error|unavailable|available>
Optionally specify a custom error message and/or the element that is required. The "Required" rule will pop open a box that lets you select a target from any other 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.
Target Limitations
When selecting a target element for Required, Available or Unavailable, the only limitation is that you may not pick the same element that you have attached the validation rule to. This would create an endless loop so is not permitted.
Rule Explanation
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
- Groups - no value to validate against
- Branches - 0 = unchecked, 1 = checked
Certain rules, like "Membership is valid", are not item-specific and so can be attached to nearly any item in the form layout.
Common Rules
These validation rules are available for any element on the form layout. Not all rules make sense in all combinations.
- True if the value is blank - The question answer
- True if the user value equals your value (case-insensitive) - The question answer or the package quantity
- True if value matches any found in list - The question answer or package quantity appears in a comma-delimited list of answers you provide
- True if the value is equal to this number - Compares the question answer or package quantity numerically
- True if the value is greater than this number - Compares the question answer or package quantity numerically
- True if the value is less than this number - Compares the question answer or package quantity numerically
- True if membership is valid - Checks membership verification through start date of event; for groups with National verification services like SCCA, BMW CCA, PCA and MBCA, it means in the National organization, for all others it means against your uploaded membership file
- True if membership is valid during registration - Same check as above but checks if the member is valid at the time of registration
- True if membership in your club is valid - Checks membership verification through start date of event; for groups with National verification services it means in your specific region/section/chapter, for all other organizations it is the same as the previous rule.
- True if membership in your club is valid during registration - Same check as above but checks if member is valid at the time of registration
- True if license in list is valid - Currently for SCCA regions only, it looks up to see if a license is valid in the National database. You must specify at least one Program and License type separated by a colon such as: "solo:safety steward". You may separate multiple valid program:license pairs with commas for any combination in the license validation list.
Rules for Questions
- True if the length is equal to this number - Compare to the number of characters in the answer to the question
- True if the length is greater than this number - Compare to the number of characters in the answer to the question
- True if the length is less than this number - Compare to the number of characters in the answer to the question
Rules for Assigners
- Assigner class is one of the specified - True if the class selected by the user is in the comma-delimited list provided. Most commonly used for "SRF,FE" to enforce SCCA compliance fees.
- Assigner group is one of the following - True if the group selected by the user is in the comma-delimited list provided.
- Transponder number is valid - Checks the selected vehicle for a valid transponder number (defined as a number four digits or longer for compatibility between DBCom and AMB systems)
- True if vehicle make is found in specified list - Checks the make of the selected vehicle. Used typically by marque car clubs to restrict participation to one make of vehicle like Porsche or BMW only.
- True if vehicle model is found in specified list - Checks the model of the selected vehicle.
- True if vehicle year is found in specified list - Checks the year of the selected vehicle.
- True if official weight is not empty - Checks the vehicle official weight is not blank
- True if engine displacement is not empty - Checks engine displacement is not blank
- True if GCR/rules page number is not empty - Checks GCR/rules page number is not blank
- True if log book number is not empty - Checks log book number is not blank
- True if VIN number is not empty - Checks VIN number is not blank
- True if tire brand is not empty - Checks tire brand is not blank
- True if color is not empty - Checks vehicle color field is not blank
- True if modifier is empty - Checks class modifier/PAX field is blank
- True if class in list is selected and modifier is not empty - True if the class selected by the user is in the comma-delimited list provided and the class modifier/PAX field is not empty. Generally used by Solo/Autocross groups to list non-indexed classes to prevent selecting a modifier/PAX.
- True if class is selected and modifier is not in mapping list - Providing a list of allowable classes and modifiers using the format "Class1,Class2,...:Modifier1,Modifier2,Modifier3,...", returns true if the class selected by the user is found AND the modifier is not found. Generally used by Solo/Autocross groups to list indexed classes and their permissible modifiers/PAX. Note that this will require a modifier/PAX for the listed classes as an empty modifier/PAX will not be found.
Future Rules
These rules may become available in the future as we uncover use cases for them:
- True if one of the values is not blank - Not implemented
- True if parent value is equal to this value (case-insensitive) - Not implemented
- True if value matches the specified regular expression [ADVANCED] - Not implemented
Autocross/Solo Indexed Class Validation
Autocross/Solo groups frequently use class modifiers to support indexed classes and PAX/RTP competition. We offer specialized support through two Modifier-related rules:
The first rule above is "True if class is selected and 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 "True if class in list is selected and modifier is not empty". 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 "True if modifier is empty". This rule lets you require the attendee selects a modifier for a given assigner.
More Examples
For more examples of validation rules in action, take a look at our Event Recipes which give real-world uses for each type.
Missing Targets
It is possible for a validation rule (either Required or Unavailable) to be created without selecting an element to act against (the "target"). When this happens, the registration form will display a message like:
- There is a configuration problem with this form that requires the attention of the registrar. "Registration Fee" has a validation rule with an invalid target for a "REQUIRED" action. See http://www.MotorsportReg.com/help/kb/FormValidations for documentation. The registrar must select a target or remove this validation rule.
To correct this, open the Form Builder and look at all of the validation rules (the red push pins), and you will fine one of them, either a REQUIRED or 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 checked for either the Required or Unavailable 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.
Knowledge Base