Dynamically Hiding Content

A Visibility Expression attribute hides the host question or response, unless the attribute's expression returns one of the following:

  • Any number other than 0, which the parser equates to False.
  • The string "True".

Visibility expressions are re-evaluated each time there is a postback to the server, for example when a button is clicked.

Implementation:

  1. Switch to the Definition tab.
  2. Select the intended question group.
  3. Add the target content, i.e. a question or response.
  4. Plan conditions under which target content should be visible. If they do not already exist, create methods of making these conditions possible (e.g. assignment expressions).
  5. Create any design-time variables needed to support the visibility conditions.
  6. Within the Definition tab, right-click the target item.
  7. Select Attributes.
  8. Add a new attribute with the type Visibility Expression.
  9. Switch to the new attribute's Value panel.
  10. Use the Attribute Expression field to write an expression that, if your planned conditions occur, will return one of the trigger values listed at the top of this topic, causing the target content to appear.
  11. Click OK.