Skip to main content

Select

An advanced select box with a set of options to choose from.

Select form control with an open dropdown list of numeric options in DHTMLX Suite

Related sample: Form. All controls

Related sample: Form. Select

Adding Select​

You can add a Select control during form initialization:

const form = new dhx.Form("form_container", {
rows: [
{
type: "select",
name: "select",
label: "select",
labelWidth: "50px",
width:"200px",
options: [
{
value: "1",
content: "1",
disabled: true
},
{
value: "2",
content: "2"
},
{
value: "3",
content: "3"
},
{
value: "4",
content: "4"
}
]
}
]
});

Properties​

View the full list of Select configuration properties.

Working with Select​

You can manage a Select control with the methods and events of the object that the getItem() method returns.

For example, you can get the value of the control:

const value = form.getItem("select").getValue();

Methods​

Check the full list of Select methods.

Events​

Check the full list of Select events.