Conditional Dropdown Input Fields
ATTENTION: THIS IS OUR OLD SITE. TO SEE OUR NEW WEBSITE, CLICK HERE.
It is often helpful to break up large lists into conditional lists when requiring users to choose options from a dropdown menu. For example, when a city input is required from a dropdown list - it is easier for the user to pick their region first and then be presented a shorter list of locations within the selected region to choose from.
The screenshot below shows a conditional dropdown input. In this case the Region field is enabled on page load while the Sub-Region is disabled on page load. Once the Region has been selected (Canterbury in this case), then other options in the Sub-Region are made available using code. The options of each dropdown will be defined using code. Connect both dropdowns to the dataset and fields you would like the input data to be saved. Ensure that the dataset you are saving to is write-only and that the collection has the appropriate user permissions. Give each dropdown input an alias (iptRegion and iptLocation in this example). Add an onChange event listener to each button.

The options for the conditional dropdown inputs are stored as a collection (called Region), similar to the screenshot below. There is a region field, a sub-region field called location and a numeric field to maintain a predefined sort order for the regions and sub-regions. Each region entry is repeated for every sub-region (or location) entry and will be de-duplicated on use. You do not need to add the dataset with the dropdown options to your page - the collection will be referenced directly using code. Dropdown options should be mutually exclusive - so for this example we have 'Other or Not Specific' as an option to account for smaller locations not listed, or if all of the region is sought by the user.
