Hello J.D., Thank you for this recommendation. I am trying to do something similar and trying to adapt the code to drop down menus.
This is what I am trying to do:
I have 3 drop down menus, #dropdown1, #dropdown2 and #dropdown3
#dropdown1 menu have two options “Selection 1”, “Selection 2” and is not collapsed.
When “Selection 1” from #dropdown1 is selected, expand #dropdown2, otherwise if “Selection 2” is selected then expand #dropdown3 instead. This is what I tried and it’s not working (not sure if I understood the code right):
$w(“#dropdown1”).onClick( (event) =>
$w(“#dropdownBox1).collpased ? $w(”#dropdownBox1).expand() : $w(“#dropdownBox1).collapse();
})
$w(”#Selection1").onClick( (event) => {
$w(“#dropdown2).expand();
})
$w(”#Selection2").onClick( (event) => {
$w("#dropdown3).expand();
})
I understand that the first line is for the click button you suggested above, but can’t get it to work for the dropdown menu. Also, #selection1 and #selection2 does not automatically show to select like the #dropdown from the code section. Is that because I can’t do it?
was thinking of making it this way too:
Instead of drop down menus, have text boxes with the selections from the drop down menus, and when they click one to expand a new set of text boxes.
Code:
$w(" #text1 ").onClick( (event) =>
$w("#text2).collpased ? $w(“text2).expand() : $w(” # text2).collapse();
})$w("#text3).collpased ? $w(“text3).expand() : $w(” # text3).collapse();
})$w("#text4).collpased ? $w(“text4).expand() : $w(” # text4).collapse();
})
But I think that is not efficient because I want to scale it up once I get this small example done, aiming to add around 5-10 different selections on dropdown menus, reaching 10 dropdown menus in total, while connecting all these drop down menu selections to a database .
Can you please advice? Thank you for all your help.
Yousef