Search⌘ K
AI Features

Enumeration Attributes

Understand how to use enumeration attributes in front-end web applications with plain JavaScript. Explore methods to display and handle single and multi-valued enumerations using drop-down lists, radio buttons, and checkbox groups. Gain practical knowledge to create user-friendly interfaces with enumeration inputs.

We'll cover the following...

An enumeration attribute is an attribute that has an enumeration as its range.

In the user interface, an output field for an enumeration attribute would display the enumeration label, rather than its internal value, the corresponding enumeration index.

Taking inputs

To allow user input to an enumeration attribute, we can use the UI concept of a drop-down selection list, which may be implemented with an HTML select element. The enumeration labels would be used as the text content of its option elements. In contrast, the enumeration indexes ...