Toggle menu

Filtering Values in Lists

If your values are organised into groups, the filterOptions helper function can be used to control which options appear.

This example has two fields. COUNTY is a drop-down field with a list of county names:

List Options - Counties

TOWN is a is list box with these options:

List Options - Towns

The groups of the TOWN field match the values of the COUNTY field.

When the value of the COUNTY field changes (ie when a county is picked) a handler function filters the TOWN field's values by the chosen county (ie by the chosen group): 

Filter Options

filterOptions takes a comma separated list of group names, and will display the values from those groups. In this example the value of the COUNTY field is used directly, but you could take your group names from anywhere on your form, including creating a list with all possible group names to "show all".

Share this page

Facebook icon Twitter icon email icon

Print

print icon