Skip to main content

IsChecked

Checks if checkbox widget is checked.

Syntax

expression.IsChecked();

expression - A variable that represents a ApiCheckboxWidget class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

This example gets checkbox widget checked prop in group of checkbox widgets.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let radiobuttonField = Api.CreateRadiobuttonField([10, 10, 25, 25]);
page.AddObject(radiobuttonField);

radiobuttonField.AddOption(0, [10, 30, 25, 45], 'Choice1');
radiobuttonField.AddOption(0, [10, 50, 25, 65], 'Choice2');
radiobuttonField.AddOption(0, [10, 70, 25, 85], 'Choice3');
radiobuttonField.SetCheckInUnison(true);

let widgets = radiobuttonField.GetAllWidgets();
widgets[0].SetChecked(true);
console.log(widgets[0].IsChecked());