Hi everyone!
I am making conditional forms. one of my conditions is that, if someone chooses “no” from a dropdown, the next dropdown will be showing and they can choose from it.
I am able to do the colapse and expand condition, However, when I choose collapsed as a default value all the elements are gone!
If I uncheck collapsed, the elements will appear again!
any ideas on how to keep the “collapsed” checked and being able to see the choices of the dropdown?
What do you mean with: “when I selected collapsed as a default value all the elements are gone”? Collapsed as a default value only collapses the selected element, only if they are inside a container and you are collapsing that container.
for my second dropdown, i want it to be collapsed and be visible only if the clients answer “NO” to the previous question.
so i chosed collapsed as a default value for this dropdown since i don’t want it to show.
Now when clients answer “NO”, the dropdown shows(expands) but without it’s choices?
how can i bring back the choices of the dropdown?
I found the solution I guess, insteqd of choosing collapse as default value, I had to put it in my code.
$w ( "#dropdown3" ). collapse ();
//DROPDOWN4
$w ( "#dropdown4" ). onChange ( **function** () {
**let** dropdownvalue = $w ( "#dropdown4" ). value
**if** ( dropdownvalue === "Non" ){
$w ( "#dropdown3" ). expand ();
console . log ( $w ( '#dropdown3' ). value );
} **else** {
$w ( "#dropdown3" ). collapse ();
}
})
1 Like
Happened the same to me. Thanks for sharing your solution!