Dependent Controls Library

Dependent Controls is a library for making dependent drop-downs quickly and easily. It works with controls when one list of data depends on another list. The child drop-down will be shown only when the value in the parent drop-down is selected.

View Examples Documentation

Example Pages

Below there are various example pages of dependant controls in multiple layouts and with different CSS frameworks.

Features

Dependent Controls is a library for making dependent drop-downs quickly and easily. It is written in pure ES6 JavaScript and doesn't have any dependencies. The library supports SELECTs, radio buttons, and any other custom HTML. Any CSS framework can be used for styling.

Data Sources

The library supports three main data sources:

  • Single JSON file. In this case, all data is placed within a single JSON file, which is loaded once on page load.
  • Javascript object. This data source is the simplest one. Just create a JavaScript object and pass it to the library via the dataSource property.
  • Custom function. The custom function allows to apply any logic and, for example, bring data from the server-side.

Storage

The library supports storage to save the current state and restore it after page refresh or when the back button is pressed.

Callback Functions

The library supports multiple callback functions:

  • onSubmit.
  • onReset.
  • onChangeStart.
  • onChangeEnd.
  • onDisableControl.
  • onEnableControl.