I have a radiobuttongroup with three options. If user selects option 3, I want to expand a box on the page.
I'm trying to write an if statement in an on change event, so that the box expands if option 3 is selected, but stays collapsed with the two other options. How do I identify which option is selected with code?
Current code:
export function radiobuttongroup1_change(event) {
if ($w('#box').collapsed) {
$w('#box').expand();
}
else
$w('#box').collapse();
}
Thank you.
WRONG Syntax if ($w('#radiobuttongroup1').selectedIndex = 3 {
must be:
if ($w('#radiobuttongroup1').selectedIndex === 3 {
Will, you will need to wrap another if statement around what you have above based on the value of the selectedIndex property.
https://www.wix.com/corvid/reference/$w.RadioButtonGroup.html#selectedIndex