Resting Radio Buttons when Radio Button Field is hidden

Avatar

Avatar

linseys32573127

Avatar

linseys32573127

linseys32573127

24-10-2019

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

25-10-2019

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