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

Remove all instances of a subform by a radio button option

Avatar

Avatar
Validate 1
Level 2
meem23
Level 2

Like

1 like

Total Posts

94 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
meem23
Level 2

Like

1 like

Total Posts

94 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
meem23
Level 2

14-10-2015

I have a radio button with Yes/No options.  If the user selects 'Yes', a group of questions and a button are made visible.  If the user wants to add an additional group of questions they are to click on the button that was just made visible.  The additional group of questions are in a subform that will repeat if the user clicks on the button. If the user changes their mind from 'Yes' to 'No', I need to have the subforms that were added removed. How can all instances of repeating subform be removed by selecting the 'No' option?

Yes Radio Button script:

if (this.rawValue == 1) {

   subform.presence = “visible”;

}

Button Script:

  _subform2.addInstance(1);

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

14-10-2015

You can control the number of instances with the setInstances() method.


  // Remove all instances of subform2
_subform2.setInstances(0);


Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
meem23
Level 2

Like

1 like

Total Posts

94 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
meem23
Level 2

Like

1 like

Total Posts

94 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
meem23
Level 2

14-10-2015

Perfect.  Thanks so much!!