​​​How to hide/show a control based on a value in a dropdown list?

Last Update: September 21, 2018

Suppose you have a DropDownList control named "DropDownList1" that includes the following items: Value1, Value2 and Value3, and you want to make another control named "Date1" to be visible if the selected value in the "DropDownList1"is Value2.
To do that, add a new rule on the "Date1" control as follows:

  1. Change the Rule Name as desired.
  2. Change the Rule Type to Formatting.
  3. Change the Event Type OnChange.
  4. In the Condition section in the Rule Manager, add the following code:
    getValue(DropDownList1) == "Value2";
  5. Check the Visible checkbox and choose Yes.
  6. Click on the Save button to save the rule.