Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
21

Help With Script

Explorer ,
Nov 12, 2023 Nov 12, 2023

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.
  • Root30508685nqnx_1-1699820538241.pngonce 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)

Root30508685nqnx_2-1699821041023.png

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.

 

Root30508685nqnx_3-1699821525243.png

  • 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.

 

TOPICS
Create PDFs , JavaScript , PDF , PDF forms
346
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2023 Nov 12, 2023
LATEST

- 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines