Certain elements of a form may need to be hidden when certain responses are given to preceeding questions. For example, a "Select a State" dropdownlist may only appear if "United States" is selected from the "Select your Country" dropdownlist. This is an example of a Conditional Form Object. Conditions may be set on entire Pages, Sections, Questions, or Responses. Conditions may be as simple or as complex as the form requires. The above example requires a simple conditional: If x = y then z is True. In other words if the "Country" (x) is "USA" (y), then "State" (z) IS visible (true). A complex condition uses joined conditions. In other words, you must create two or more conditions, and join them in a third condition. For example, Condtion 3 below is simply the two preceeding conditions joined by a "conjunction" (and or or):
Condition 1: (x > 5)
Condition 2: (y = "True")
Condition 3: (x > 5 OR (y = "True"))
To make it more complex, add a fourth condition. (Note: the Condition 5 is simply Condition 3 and 4 joined by a conjunction.)
Condition 4: (z < 10)
Condition 5: (z < 10 AND ((x > 5) OR (y = "True")))
Condition 5 above requires that z be less than ten and either x is greater than five or y is equal to "True". Note that the more concise the condition the quicker the processing time. It is therefore recommended that conditions be used sparingly.
There are three requirements which must be met before a question response can be used as a condition for other form objects; they are as follows:
- The response(s) must be presented in a dropdownlist control.
- The response(s) on which an object's visibility depends must appear before the object.
- The response(s) used in the conditional statements must be given an intuitive name.
Setting a condition is a three step process:
- Ensure that all question responses used in the condition have intuitive names. (See Wizard Help: Question Response Information.)
- Create the condition(s).
- Apply the condition(s) to the object.
Before creating a condition, all of the responses to be used in the conditions must be given intuitive names. See Wizard Help: Question Response Information for more on creating intuitive names for question responses.
Select Manage Conditions from the left navigation menu (under Formulation). Super Admin users may choose a department from the Department dropdownlist. All other users (Department Admin and Formulators) default to their own department and cannot select another one.
Select a form. Note that the following message will appear if no responses exist with an intuitive name: The selected form has no named responses from which conditions may be created. Otherwise, all previously defined conditions will be listed (if any exist). To modify a condition simply click on it, otherwise, click Add Condition to create a new one.
Select the response whose value shall be tested. This dropdownlist contains all valid responses (see requirements above). The page will automatically refresh whenever the selection is changed and present appropriate "test type" options depending on whether the input type is numeric. If it is, in fact, numeric the options are as follows:
- Not equal
- Greater than
- Less than
- Greater than or equal
- Less than or equal
If the input type is not numeric, only the first two options (Equals and Not equal) are available.
Once the response control and the test type are selected, choose the value from the last dropdownlist to be tested against. Click the Add or Update button to save the selections and return to the updated list of conditions for the selected form.
Note that once a condition is created, it can be deleted by simply selecting it and clicking the delete button that appears in edit mode.
Once at least two conditions have been created, you can join them to build complex conditions. From the form conditions list, click on the Join button (chain link icon) beside one of the conditions that shall be joined. On the next screen, select the appropriate conjunction from the dropdownlist (AND or OR), and select the radiobutton that corresponds to the other condition you wish to join it to. For complex conditions that utilize a combination of OR and AND conjunctions, it may be important to add the conditions in the proper order; thus, care should be taken when planning your criteria. Once a condition has been joined to another, you can remove the join by simply changing the conjunction (from AND or OR) to nothing at all.
To set a condition on an element (or "form object"), enter the Manage Forms (i.e., form builder) screen, select a form and the appropriate page. Find the object on the page to which a condition shall be applied, open the pop-up menu corresponding to the object, and click the Conditions link to enter the Conditions screen. Simply select an existing condition (or complex condition) and whether the object should be visible or hidden if the conditions are met. If the condition is visible only if the condition is met, the object will initialize as hidden. To remove a condition click the Remove button. Note, if the required condition does not exist, you must create the condition(s).