Skip to main content
Known Participant
November 12, 2023
Question

Help With Script

  • November 12, 2023
  • 1 reply
  • 324 views

Hello,
I'm new to java scripts on adobe.
I'm just using it to make my maintenance forms in pdf.    below is part of the form i would like help with please.    

  • by default, the table should look like this.
  • once the checkbox has been activated, as shown below. I can do it with the script below:

(I took it elsewhere to adapt it to my case)

var nHide = event.target.isBoxChecked(0)?
display.visible:display.hidden;
this.getField("Check Box9").display = nHide;
this.getField("Text33").display = nHide;
this.getField("Text34").display = nHide;
this.resetForm("Check Box9");

this.getField("Group10").display = nHide;
this.resetForm("Group10");
this.getField("Group11").display = nHide;
this.resetForm("Group11");
this.getField("Group12").display = nHide;
this.resetForm("Group12");

this.getField("Check Box10").display = nHide;

this.getField("Check Box11").display = nHide;
/*this.resetForm("chek Box11");*/

this.getField("chek Box10").value = "";

 

  •  i would like that, when I click on clear (Nettoyer), I'd like the form to reappear as in image 1.

 

  • with the scrirpt posted above.
    when I click on 1, (2,5, 6, 7, G1,G2,G3) are activated.
    and when I activate 2 (3,4, G4, G5) also activate and when it's deactivated, (3,4, G4, G5) also deactivate.

    the other concern is that, if I deactivate 1 directly without deactivating 2 first, (3,4, G4, G5) remain activated. but I'd like to deactivate 1 so that all elements are deactivated too.

    It's probably a bit difficult for me, but I'm still available to provide as much information as I can to help you help me.

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 12, 2023

- Add a script to this button to show/hide the fields in question as desired.

- If you don't want the user to be able to select more than one field in a group of radio-buttons or check-boxes fields then give those fields the same name (but different export values) and they'll act as a mutually-exclusive group automatically.