isChecked()
checks whether a checkbox of the CheckboxGroup control is checked
isChecked(id?: string): boolean | { [key: string]: boolean };
Parameters:
id: string
- optional, the id of a checkbox
Returns:
Either a boolean value or an object.
Returns boolean value if the id of a checkbox is specified. true
, if the checkbox is checked; otherwise, false
.
Returns an object if the id of a checkbox is not specified.
Example
form.getItem("CheckboxGroup").isChecked("checkbox_id_3")
// -> true/false
If the id of a checkbox is not specified, the method returns an object with a set of key:value pairs where key is the id of a checkbox and value is the state of the checkbox:
form.getItem("CheckboxGroup").isChecked()
// -> { "checkbox_id_1": true, "checkbox_id_2": false }