Search...
value
Sets or gets the value of the selected options.
Description
Setting the value
property sets the options
with those values to be the selected options. You must set the value
property to values that exist in the options
list.
To reset the checkbox group to have no options selected, set the value
property to an empty array.
Getting the value
property returns the values of the currently selected options. If no value is selected, the value property returns an empty array.
Note: Changing an element's
value
in code does not trigger anonChange
event.
Type:
Array<string>Read & Write
Was this helpful?
Get the values of the selected options
Copy Code
1let myValue = $w("#myCheckboxGroup").value; // ["value1", "value2"]
Set the selected options by values
Copy Code
1$w("#myCheckboxGroup").value = ["value1", "value2"];