Related select boxes

Related select boxes are a common requirement (generally described as "two selects related", "three selects related" or "n-selects related"). The visitor selects an option from the first box, and this changes the set of options available from the second box.

Two examples are provided here. The first, simply reloads the form when a select box changes. This is easy to implement, but it is clumsy and provides poor accessibility.

The second example relies on qForms, a powerful JavaScript API for working with HTML forms. For the qForms example to work, you must download and install the qForms JavaScript API independently. The example assumes qForms is available at the web path /lib/. If the demo doesn't seem to work, this path is probably wrong. You can change it by editing the value for attributes.qFormsPath in customtags\terraform\en\US\defaults.cfm. It is important to note that qForms relies on JavaScript, a case-sensitive language. You must make sure you capitalise your form names consistently wherever you refer to them.

Techniques demonstrated