Skip to main content
Known Participant
November 11, 2022
Beantwortet

Cocher / décocher checkbox

  • November 11, 2022
  • 2 Antworten
  • 1353 Ansichten

Bonjour (toujours débutant en JS mais je progresse grâce à vous),

Malgré des recherches sur la communauté et plusieurs tests de codes, je n'arrive pas à faire la manipulation suivante :

J'ai 4 checkboxs (ERP, PA, CTS, PYRO), j'aimerai que les 3 autres checkboxs ne soient plus cliquables lorsque j'en sélectionne une.

Je vous remercie de votre précieuse aide.

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von Mike Bro

Hello @Caribou_Des_Bois,

 

Take a look at the post below to see answers your question...

https://community.adobe.com/t5/acrobat-discussions/checkbox-behavior-enables-or-disables-other-checkboxes/m-p/11674256

 

Regards,

Mike

2 Antworten

Mike BroAntwort
Legend
November 11, 2022
try67
Community Expert
Community Expert
November 11, 2022

You can use this script as the Mouse Up event of "ERP", for example:

 

var otherFieldNames = ["PA", "CTS", "PYRO"];
if (event.target.value=="Off") {
	for (var i in otherFieldNames) this.getField(otherFieldNames[i]).readonly = false;
} else {
	this.resetForm(otherFieldNames);
	for (var i in otherFieldNames) this.getField(otherFieldNames[i]).readonly = true;
}

Adjust the first line and re-use the code for the other fields.

Known Participant
November 12, 2022

Bonjour try67,

Merci infiniment de votre aide, le code fonctionne très bien 🙂