Expand my Community achievements bar.

Repeating subform controlling actions in original subform

Avatar

Level 1

Hi,

Thank you S.Candy and Magnus069 for helping me get my form this far.

I am having one final (I hope) issue.

I have repeating subforms in my form.  The subforms have radio buttons that control the presence of of comments boxes.  If the user clicks "no" then a comments box appears, if they click "yes" it disappears. 

The issue I am having is when the user adds an instance of the subform (using the add button) then the send set of radio buttons controls the comments box in the first instance.

Maybe a picture will help?

‌spection form.jpg

Please Help!

4 Replies

Avatar

Level 10

Can you please post your form or at least a screenshot of your form hierarchie and the script your using to show/hide the comments?

Avatar

Level 1

Of Course!  Anything to get this solved   I have just used the action buttons to add and remove the repeating subforms.  Here is the screenshot.  If you need another view just let me know.LCscreenshot.jpg

Avatar

Level 10

Ok,

the problem is that you're using a SOM expression beginning at the root object for your form.

As the PDF viewer interprets every object without an explicite accessor as the first instance your script points alsways to the first instance of a repeatable object.

xfa.form.form1.Inspection.FireExtinguisherInspection... is interpreted as xfa[0].form[0].form1[0].Inspection[0].FireExtinguisherInspection[0]...

As the comments objects are located in the same level you can use a much shorter SOM expression, that is interpreted as a relative path.

UnubstrucetedComments.presence = "invisible";

Avatar

Level 1

Thanks!  This worked perfectly....saved me so much frustration