Use enablewhen
with tables to enable or disable table rows and columns. Put the enablewhen
tag within the row or column definition upon which it should act. When the condition on the enablewhen
tag is met, the second row (or column) is active. When "Don't know" is selected in the first row or column, the second row or column is disabled.
The IntelliSurvey software automatically handles all validation associated with enablehwen
. If there is a required
tag acting on the table, it will not require a response for disabled fields.
Note: The enablewhen
tag works on all question types. Examples of enablewhen on non-table questions can be found here.
Single reference
Iterative reference
A common request for tables is for certain response columns or rows to disable for all question cells, based on the response to another column or row. To execute this, use __RID__ and __CID__ references to indicate enablewhen
should act across the whole table. RID is a mnemonic for "row ID," and CID for "column ID." In the below example, the enablewhen
logic uses the __RID__ reference. Much like the [id] reference used in a condition element decorator, it is iterative for all rows of the table. When acting on row 1, the value of __RID__ is "1." For row 2, it is "2," and so on.
For more on __RID__ and __CID__ syntax, see RID Syntax.
When 'Do not purchase' is selected for any row in the first column of the table, the second column will be disabled for that row.
Rows and columns - internal dynamic reference
It is possible to reference a different column or row within the same table with a static reference, however, it is far more common to need a given behavior to be iterative for all table rows or columns. When __RID__ or __CID__ syntax is used, it indicates the current row/column. Much like the '[id]' reference used in the condition element decorator, it is iterative for all rows of the table. When acting on row 1, the value of __RID__ is 1. For row 2, it is 2, and so on.
The second column remains hidden until 'Unsure' is selected for any row. When an 'Unsure' is selected, the column becomes visible, but only the row for which it is selected contains an active field.
Excluding a column from the logic
In the following example, enablewhen
is used to provide respondents with an opt-out column '98'. If the respondent checks the box under column 98 for a given row, the options from the other columns of that row are disabled. To reactivate the row's other columns, unclick 'I do not own this product' under column 98.
Comments
0 comments
Please sign in to leave a comment.