Event Handling

I am trying to show an upload button when a checkbox is checked and hide the button when it is unchecked. Following is the code that I typed but not showing the required result. Can someone please help me with it?

export function checkboxGroup1_click(event) {
if ($w( ‘#checkboxGroup1’ ).enabled){
$w( ‘#uploadButton1’ ).show();
}
else if ($w( ‘#checkboxGroup1’ ).enabled){
$w( ‘#uploadButton1’ ).hide();
}
}

You want to test for Checkbox.checked .

Thank you

The code shows that "checked does not exist as ‘#checkboxGroup1

If you want to use a CheckboxGroup, then you need to check if the appropriate checkboxes in the group were selected using CheckboxGroup.value .

If you only need one Checkbox, and not a group, then you should use the Checkbox element.