Property Dependencies
Survey Creator allows survey element properties to change their behavior and visibility depending on the values of other properties. This demo illustrates how this functionality enables you to fill choices and control property visibility based on certain conditions.
To see this functionality in action, do the following:
Conditional choices
In the Property Grid, ensure that Survey is selected in the element selector and expand the Geo Location section. Change the "Region" property value and open the "Country" property editor. You should see that its choice list is filtered based on the selected region.Conditional visibility
In the Property Grid, select question1 from the element selector. Change the "Input type" property value todate
,datetime
, ordatetime-local
. You should see that the "Date format" property becomes visible. If you select another input type, "Date format" will be hidden.
To establish a dependency between properties, specify the dependsOn
option for a dependent property. This option accepts an array of property names upon which the current property depends. When one of the listed properties changes, the dependent property reevaluates its visibleIf
and choices
functions. This behavior allows you to control the property visibility and fill choices conditionally. Refer to the following help topic for more information on how to configure custom survey element properties: Add Custom Properties to the Property Grid.