Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Hide/show multiple subforms based on dropdown selection

Avatar

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile
usuggestaname
Level 1

04-03-2015

Hi - I am wanting to use a selection from a dropdown to hide/show 17 subforms that contain text only.I've tried if/else statements that I've used in the same way before but I'm having problems making it work this time. Is there a better way to do this when multiple subforms are required to hide/show. Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

04-03-2015

What event are you triggering the action on? I have the following on the Exit event and it works.

if(this.rawValue == "Hide"){

subForm1.presence = "hidden"

}

else

if(this.rawValue == "Show"){

subForm1.presence = "visible"

}

If however you have the "Specify Item Values" button clicked on the Binding tab you will need to change the values from "Hide" to their specified value i.e. "1"

735785_pastedImage_1.png

Then you would change the code to:

if(this.rawValue == "2"){

subForm1.presence = "hidden"

}

else

if(this.rawValue == "1"){

subForm1.presence = "visible"

}

Answers (1)

Answers (1)

Avatar

Avatar
Level 1
DaveSQN
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
DaveSQN
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
DaveSQN
Level 1

09-03-2015

if (this.rawValue == "Value 1" || this.rawValue == "Value 2") { //Select which options on the dropdown you want to use

  this.resolveNode("subform").presence = "hidden"; //Sets the subform "subform" to hidden

}

Alternatively use the Action Builder in the tools menu and make sure you are putting the Javascript on the "Change" event.