Skip to main content

Checkbox

A control that allows displaying the specified value or change it to the opposite one.

Checkbox control

Related sample: Form. All controls

Related sample: Form. Checkboxes

Adding Checkbox

You can easily add a Checkbox control during initialization of a form:

const form = new dhx.Form("form_container", {
rows: [
{
type: "checkbox",
label: "I agree",
name: "agree",
id: "agree",
value: "checkboxvalue"
}
]
});

Properties

View the full list of configuration properties of the Checkbox control.

Working with Checkbox

You can manipulate a Checkbox control by using methods or events of the object returned by the getItem() method.

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

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

Methods

Check the full list of methods of the Checkbox control.

Events

Check the full list of events of the Checkbox control.