Skip to main content
Participating Frequently
September 19, 2024
Question

Interactive Form issue

  • September 19, 2024
  • 1 reply
  • 2227 views

I have a complex to some degree form I am setting up.

 

It includes sections of interactive elements. At the top of each section is a checkbox. If 'checked' i have set up so some fields are then be greyed out (ie not selectable). However I need the option to toggle this on and off and the fields are selectable then not. At the moment if checked and then unchecked the fields remain hidden.

 

Help pleaase

This topic has been closed for replies.

1 reply

PDF Automation Station
Community Expert
September 19, 2024

You don't show the script you are using or where it is located.  Enter the following mouse up action script in the check box:

if(event.target.value=="Off")

{

this.getField("Field1").readonly=false;

this.getField("Field2").readonly=false;

this.getField("Field3").readonly=false;

}

else

{

this.getField("Field1").readonly=true;

this.getField("Field2").readonly=true;

this.getField("Field3").readonly=true;

}

Participating Frequently
September 19, 2024

I have tried with and without script with no luck.

This is the setup without script. I have about 20 items in one section of the document that i require to be 'greyd' out when the main box is selected then require for them to be editable indicually again when unselected. They grey out they just wont come back.

 

PDF Automation Station
Community Expert
September 19, 2024

You can't use mouse down and Show/Hide a field to toggle because you have to test for the status of the fields before changing them.  You have to use a script.  My script makes them "read only" (you said "not selectable").  If you want them read only use the script above and change the field names to the actual field names and put this in a mouse up action.  If you want show/hide the fields, use the following script:

if(event.target.value=="Off")

{

this.getField("Field1").display=display.hidden;

this.getField("Field2").display=display.hidden;

this.getField("Field3").display=display.hidden;

}

else

{

this.getField("Field1").display=display.visible;

this.getField("Field2").display=display.visible;

this.getField("Field3").display=display.visible;

}