Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Show/Hide Subform with Radio

Avatar

Level 2

I am trying to get a subform to be hidden initially and only visible when one of the radio buttons are selected.  I have looked and looked on these forums and tried all different combinations but none are working.  I have the radio buttons in a different subform then the items want to hide. Any help would be great.  Here is an example of what I have.    form1.Design1.ITManQuest.ITMan::change - (JavaScript, client)    (this is where I put the script)  if (this.rawValue == "1")  {Design1.Routing.Signatures.ITSignSub.presence = "visible";} else  {Design1.Routing.Signatures.ITSignSub.presence = "hidden";}

1 Accepted Solution

Avatar

Correct answer by
Level 5

Thanks, can download it now

Looks like you are hiding some rows in the following table when you click no on the radio button group at the top? If so, then you need to save the form as a dynamic pdf. At the moment its saved as static pdf. Nothing will happen when you click No since the layout cannot be changed in static pdf's in the way you are attempting to do. Just resave as dynamic and the preview should start working correctly.

Should probably set the ITSignSub subform to hidden initially

View solution in original post

8 Replies

Avatar

Level 5

I tried your code snippet on a quick form and didnt find any issues with it. As long as you have the correct layout in your form design then it should work. Make sure you have the code on the RadioButtonList and not on the individual radio buttons and check the subforms are laid out correctly in the hierarchy window. If you are trying to collapse a subform then make sure you are using flowable content in the parent subform. Maybe a sample of the problem might help to see whats going wrong.

Avatar

Level 2

Here is the link for the document.  I cut some of the extra stuff out but left all the subforms.  Any help would be great.  Thanks

https://acrobat.com/#d=gEqVOXJB*FMuRDxJnooV4w

Avatar

Level 5

Dont seem to be able to open it. Says not found or do not have access

Avatar

Level 2

Sorry about that.  First time I've used that.  The below link should work now.

https://acrobat.com/#d=Dujk6k93wkCSHzLcQKnqnw

Avatar

Level 5

Did you publish the form? Sorry but still cant see it.

Avatar

Level 2

Could have swarn I published it before.  Try this link.  I went back and re-did the publishing.

https://acrobat.com/#d=gEqVOXJB*FMuRDxJnooV4w

Avatar

Correct answer by
Level 5

Thanks, can download it now

Looks like you are hiding some rows in the following table when you click no on the radio button group at the top? If so, then you need to save the form as a dynamic pdf. At the moment its saved as static pdf. Nothing will happen when you click No since the layout cannot be changed in static pdf's in the way you are attempting to do. Just resave as dynamic and the preview should start working correctly.

Should probably set the ITSignSub subform to hidden initially

Avatar

Level 2

Thanks!! That did the trick.  Can't believe I forgot that.