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(); } }
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.
You want to test for Checkbox.checked.