Let say that the first checkbox (value “1” ) opens an input element with ID input1 and the second option (value “2” ) should open input2 and so on.
So do something like:
let numberOfCheckboxes = 8;
let ids = [];
for (let i = 0; i < numberOfCheckboxes; i++){
ids.push((i + 1).toString);
}
$w.onReady(() => {
$w("#checkboxGroup").onChange(event => {
const selected = $w("#checkboxGroup").value;
const notSelected = ids.filter(e => !selected.includes(e));
notSelected.forEach(e => $w("#input" + e).collapse());
selected.forEach(e => $w("#input" + e).expand());
})
})
Make sure to use these values or modify the code.
P.S [fixed]