Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Script pour empecher le remplissage de cases, probleme avec le bouton effacer du formulaire

New Here ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

Bonjour,

J'ai trouvé ce script pour empêcher le remplissage de certaines cases lorsque d'autres sont cochées:

if (event.target.isBoxChecked(0)) {
this.getField("Nom").value = "";
this.getField("Nom").fillColor = color.ltGray;
this.getField("Nom").readonly = true;
} else {
this.getField("Nom").fillColor = color.white;
this.getField("Nom").readonly = false;
}. 
J'ai par la suite créé une case effacer afin réinitialiser le formulaire.
 Par contre quand je clique et ca reinitialise, les champs restent gris et je dois reselectionner de deselectionner la case pour que le gris s'efface et je cherche une solution pour que les zones grises s'effacent lorsque je clique sur la case effacer. Les cases sont pourtant selectionnés dans les cases à effacer. Voici un exemple de quand j'avais coché la case full in kind et ensuite cliqué la case effacer pour vider le formulaire:
full.png
TOPICS
Comment review and collaborate PDF, Edit and convert PDFs, How to, JavaScript, PDF forms

Views

96

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Community Professional , Jul 20, 2021 Jul 20, 2021
Oui, il faut inclure une partie du script ci-dessus dans le script de Reset. Quelque chose comme ça : if (app.alert({cMsg: "Reset all form fields?\rThis action cannot be undone. OK to continue?\r", cTitle: "RESET", nIcon: 2, nType: 2}) == 4) { this.resetForm(); this.getField("Nom").fillColor = color.white; this.getField("Nom").readonly = false; }

Likes

Translate

Translate
Adobe Community Professional ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

Script  only triggers when you click on checkbox and fields will change to white if you uncheck it manually, but if you reset checkbox with button, script won't trigger. You can add second part of script to "Reset" button or adapt script and use it in text field as "Custom calculation script".

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

Oui, il faut inclure une partie du script ci-dessus dans le script de Reset.

Quelque chose comme ça :

 

if (app.alert({cMsg: "Reset all form fields?\rThis action cannot be undone. OK to continue?\r", cTitle: "RESET", nIcon: 2, nType: 2}) == 4) {
this.resetForm();
this.getField("Nom").fillColor = color.white;
this.getField("Nom").readonly = false;
}

Likes

Translate

Translate

Report

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
New Here ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

LATEST

Ca a marché merci beaucoup 🙂

Likes

Translate

Translate

Report

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