#
Conditions
The conditions attribute can be used to modify how certain fields display in relation to other fields values.. for example, if a dropdown has one value show one set of fields and if another show another set of fields. This can be a single formula, or multiple formulas separated by a pipe character ("|").
#
Formula
CONDITION + "?" + THEN + ":" + ELSE
12023=1002?12024=show:12024=hide
CONDITION: The test to perform. If it returns true, then THEN will be performed, otherwise (optional) ELSE will be performed. In the example, if field id 12023 equals value 1002, then return true. In the case of select or checkbox fields, you can specify multiple values by comma separating them. The condition will return true if any of the values are selected (example: 12023=1002,1003,1005). The equals sign is the only operator allowed.
THEN & ELSE: The action to take if true, or the the action to take if false. This formula consists of what to take action on (field id or field ids) followed by the equals sign then action to take or actions to take (IDS=ACTIONS). IDS is a comma separated list of field IDs to take action on. ACTIONS is a comma separated list of actions to take. Predefined actions are show, hide, required, optional, and clear. If a predefined action is not used, it will instead set the value.
ACTIONS:
show: Show the field (12024=show)
hide: Hide the field (12024=hide)
required: Make the field required (12024=required)
optional: Make the field optional (12024=optional)
clear: Clear the fields value (12024=clear)
(anything else): Set the field value (12024=Hello)
ELSE: Optional. If no operator is used, the formula will assume the actions should be taken on the same IDS in the THEN part of the formula.
#
Advanced Example
conditions="10279=17940?3,10289=show,required:3,10289=hide,optional|10279=17938,17939,17941?10290,10291,10288,10292,10293=show:10290,10291,10288,10292,10293=hide"
If field 10279 equals 17940, then make fields 3 and 10289 visible and required, otherwise make fields 3 and 10289 hidden and optional. Also, if field 10279 equals 17938, 17939, or 17941, then make fields 10290, 10291, 10288, 10292, and 10293 visible, otherwise make fields 10290, 10291, 10288, 10292, 10293 hidden.