Skip to main content
Participating Frequently
May 8, 2023
Question

changing display property of widget is changing all iterations

  • May 8, 2023
  • 1 reply
  • 1085 views

I am very very new scripter in Adobe Forms.

 

I have a field (DateFiled) and there are multiple copies of that field used throughout the document (widgets #1 - #3).

 

I want #0 and #1 to be always visible, but I want #2, #3 to only be visible if the corresponding checkbox is on.

 

I found some examples and it looks like creating the script on the checkbox is the way to go. But whenever I run it, all of the boxes change to hidden, or all change to visible. Here is my code.

 

var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden;

this.getField("DateFiled.3").display = nHide;

 

and on the next checkbox:

 

this.getField("DateFiled.4").display = nHide;

 

It appeared to work...once...but when I went to test it a second time, it failed. 

 

I am so frustrated by what should be a simple task. Would it be better if I deleted the widgets altogether, and just created disconnected fields that draw the DateFiled value?

 

Thanks for your guidance. I have attached the file.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
May 8, 2023

You doesn't set nHide at the second checkbox.

Participating Frequently
May 8, 2023

Thank you! I can't believe how dumb that was. I appreciate you taking the time to answer.