Search.../

required

Gets or sets if a checkbox is required to be checked.

Description

If required is true, the checkbox is only valid if it is checked.

If required is false, the checkbox is always valid.

You can also set a checkbox to be required by using the element's Settings pane in the Editor.

Type:

booleanRead & Write

Was this helpful?

Get whether a checkbox is required

Copy Code
1let isRequired = $w("#myCheckbox").required; // true
Set a checkbox to be required

Copy Code
1$w("#myCheckbox").required = true;