Until now I worked with a simple code:
export function dropdown1_change(event, $w) {
if (event.target.value === “Value1”) {
$w (“#box2”).show();
} else {
$w (“#box2”).hide();
}
if (event.target.value === “Value2”) {
$w (“#box1”).show();
} else {
$w (“#box1”).hide();
}
if (event.target.value === “Value3”) {
$w (“#box3”).show();
} else {
$w (“#box3”).hide();
}
The problem is, I need 100+ diffrent boxes (sections). I can’t just lay one box on top of the other a 100 times and hide all other with the code, I think this will slow down the page and is troublesome if I need to do some changes on some boxes. I need to create 100+ sections for 100+ values in the dropdown menu.
Is there an other more clean way to show diffrent sections based on choosen values in the dropdown menu?
I would use a repeater and make all content in that box dynamic and populate the repeater with that data onChange. Will be speedy. Depending of course on what you are going to have in your boxes.
You can add an onChange event to the dropdown and check the value selected. If the value selected is the relevant one, show a strip with all the relevant user inputs / elements. Note that the strip should be hidden in the first place.
hi chris im working on a similar thing but my requirement is that repeater shouldnt be visible on page unless you select an item from the dropdown list. I appreciate any help.