Hey guys! First off, I appreciate all the help you can give. My current problem is I have a dropdown, that has two values. For this purpose it’ll be VALUE1 & VALUE 2. Once they select VALUE1 I want to show them a set of text boxes. If they select VALUE2 I want hide the text options for VALUE1 and show them the text options for VALUE2. I’ve tried the Wix code examples and no luck.
Few useful tips you can follow to make it easier and crystal clear to understand the code :
1- you can group the elements for the VALUE1 together ( group1) and group the elements for the VALUE2 together ( group2). so that you can hide and show the whole elements(group) at once.
2- Let the elements them selves be shown, make group1 and group2 hidden onLoad.
3- you have to check what is shown on the page to be hidden or what is hidden to be shown :
if (event.target.value === "VALUE1"){
$w("#group2").hide();
$w("#group1").show();
}
else if (event.target.value === "VALUE2"){
$w("#group1").hide();
$w("#group2").show();
}
HI, I am now having the same issue, and have followed the above, but cannot get it to work.
I have a site where I want people to choose the number of guests they would like to invite to an event, and based on their number selection the corresponding fields will appear. I.e. choose 1 guest - 1 set of fields to complete appear, choose two guests and two sets of fields to complete appear, etc. They have the option to invite 5 guests. And for each guest they have to complete 7 fields. But I only want what they have to complete to appear.
I have grouped my 7 elements as directed above so rather than having to code for 7 individual fields for each guest, they are now group1, group2 etc.
As you have directed in the thread above, I have:
Individual elements are enabled by default to show on the page, however grouped elements are hidden on the page on onload
But I cannot get the code to work?
Can someone please help me? I am really stuck and need this to work ASAP.
Thanks!!!