Expand my Community achievements bar.

SOLVED

Hidden fields become visible in new instance of subform.

Avatar

Level 2

Hello All.

I have the following issue:

I have a subform with a checkbox and a text field.  When the box is checked, the text field is visible.  When unchecked it's hidden. 

I also have a button that adds another instance of the subform.  When I click and add another subform, the hidden text field is visible in the new instance instead of remaining hidden until the box is checked.  Also, when I add the new subform instance and check the box, the hidden field becomes visible in the first instance of the subform.

Here's what I'm using to hide and unhide the fields:

if(this.rawValue==1)

(form1.subform1.textfield1.presence="visible");

else

(form1.subform1.textfield.presence="hidden");

The above is in both the change and initialize events.

I would really appreciate the help in learning how to keep each instance from affecting another, as well as how to keep the fields hidden in newly added instances of the subform.

Thanks in advance.

J

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi,

You can Add action to the checkbox control to achieve the workflow. To do this you can right click on checkbox control under hierarchy panel and then click on "Add Action". Also if you want the field to be hiddedn in new instance then at design time you should set the property of the control as hidden.

Steps to achieve the workflow.

1. Right click on checkbox control --> click on Actions --> Add Action

2.Select from the dropdown. When checkbox is unchecked.

3. Set the visibility of textfield to Hidden.

4 Click on Add a new action as shown below.

AddAction.png

5.Select from the dropdown. When checkbox is checked. 

6. Set the visibility of textfield to Visible.

7. Click on OK to create the actions and close the action window.

To set the textfield as hidden select the textfield and open its object property. Set the presence value as hidden.

************

Please download the sample file from https://acrobat.com/#d=hM8oyP3be4O3HRBt14CkYg

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3

Hi,

You can Add action to the checkbox control to achieve the workflow. To do this you can right click on checkbox control under hierarchy panel and then click on "Add Action". Also if you want the field to be hiddedn in new instance then at design time you should set the property of the control as hidden.

Steps to achieve the workflow.

1. Right click on checkbox control --> click on Actions --> Add Action

2.Select from the dropdown. When checkbox is unchecked.

3. Set the visibility of textfield to Hidden.

4 Click on Add a new action as shown below.

AddAction.png

5.Select from the dropdown. When checkbox is checked. 

6. Set the visibility of textfield to Visible.

7. Click on OK to create the actions and close the action window.

To set the textfield as hidden select the textfield and open its object property. Set the presence value as hidden.

************

Please download the sample file from https://acrobat.com/#d=hM8oyP3be4O3HRBt14CkYg

Avatar

Level 2

That worked great!  Thanks so much for your help.