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

Resting Radio Buttons when Radio Button Field is hidden

linseys32573127
Level 1
Level 1

Hi,

I have a subform with 4 radio button options that's hidden. Based on answers earlier in the form, only certain radio buttons will appear. How do I reset the radio buttons when they're hidden without creating a "Reset" button?

For instance in question 1  if they check "yes" radio buttons A B C will show. IF they click radio button A then a specific set of questions will appear. But if they uncheck yes in question 1 - then the A B C radio buttons will disappear, but the special subforms for A are still visible. Is there a way when the radio buttons are hidden that they are basically rest - which would rest the rest my form?

I have the radio buttons set up so when A is NOT selected the subforms for that option are hidden. However, when the field with the radio buttons are hidden, A is still selected, just not visible.

Hopefully this is as clear as mud.

1 Reply
_Bruce_Robertson
Level 10
Level 10

Hi,

This depends on how you have done your show/hide code.  If you were to have a subform that contained a radio button list called YesNo, one called ABC and a subform call aContent, then in the subform calculate event you could have code like;

if (YesNo.rawValue == 1) {

  ABC.presence = "visible";

} else {

  ABC.presence = "hidden";

  xfa.host.resetData(ABC.somExpression);

}

if (ABC.rawValue == 1) {

  aContent.presence = "visible";

} else {

  aContent.presence = "hidden";

}

The thing to note here is that when the ABC radio button list is hidden the value is also reset with the call to xfa.host.resetData()

Bruce