Skip to main content
christopheg39436860
Known Participant
October 30, 2024
Answered

Case à cocher dynamiques

  • October 30, 2024
  • 2 replies
  • 792 views

Bonjour,
Je souhaite que dans mon formulaire remplissable, l'action de cocher une des 2 cases à cocher du rectangle VERT rendre indisponibles les cases à cocher du rectangle BLEU. Il est donc impossible de cocher les cases de la case BLEUE.
Possible ?
Voir pièce jointe
Merci beaucoup pour votre aide,

Christophe GAUMARD

This topic has been closed for replies.
Correct answer PDF Automation Station

Enter the following custom calculation script in any text field.  I am assuming the green check boxes have the same name and the blue check boxes have the same name, which in the this example is GREEN and BLUE:

if(this.getField("GREEN").value!="Off")

{this.getField("BLUE").display=display.hidden}

else

{this.getField("BLUE").display=display.visible}

2 replies

Thom Parker
Community Expert
Community Expert
October 30, 2024

Yes, this is possible.  There are a couple of simple ways to do it, hide the other fields, or make them readonly.

Here's an article that shows how to hide/show fields. but the exact code could be used to make the fields read only by swapping the  "display" property in the code to the "readonly" property (and setting the value to true/false).

 

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
christopheg39436860
Known Participant
October 31, 2024

Merci ! 🙂

PDF Automation Station
Community Expert
Community Expert
October 30, 2024

Enter the following custom calculation script in any text field.  I am assuming the green check boxes have the same name and the blue check boxes have the same name, which in the this example is GREEN and BLUE:

if(this.getField("GREEN").value!="Off")

{this.getField("BLUE").display=display.hidden}

else

{this.getField("BLUE").display=display.visible}

christopheg39436860
Known Participant
October 30, 2024

Merci pour votre réactivité !

Je teste dès demain 🙂