abracadabraPDF › Forums › PDF – Général › Choix d’un menu déroulant et cacher des Zones › Répondre à : Choix d’un menu déroulant et cacher des Zones
17 janvier 2018 à 23:34
#63189

Maître des clés
Bonjour.
0.
C’est certainement la fatigue car tu n’avais pas posté dans la bonne rubrique :Smiley03:
1.
Code:
// si valeur C1
if (this.getField(“Choix_N”).value == “C1”) {
var cRtn = app.popUpMenu(“NFX”, “-“, “1”,”2″,”3″,”4″,”5″,”6″,”0″);
if (cRtn != null) {
event.target.value = cRtn;
}
}
// si valeur C2
else if (this.getField(“Choix_N”).value == “C2”) {
var cRtn = app.popUpMenu(“PUGH”, “-“, “A”, “B”, “C”, “D”, “E”);
if (cRtn != null) {
event.target.value = cRtn;
}
}
if (this.getField(“Choix_N”).value == “C1”) {
var cRtn = app.popUpMenu(“NFX”, “-“, “1”,”2″,”3″,”4″,”5″,”6″,”0″);
if (cRtn != null) {
event.target.value = cRtn;
}
}
// si valeur C2
else if (this.getField(“Choix_N”).value == “C2”) {
var cRtn = app.popUpMenu(“PUGH”, “-“, “A”, “B”, “C”, “D”, “E”);
if (cRtn != null) {
event.target.value = cRtn;
}
}
2. (attention aux points dans les noms des champs, voir : https://www.abracadabrapdf.net/?p=525 )
Code:
// d’abord on masque tous les champs
this.getField(“Text”).display = display.hidden;
// ensuite on affiche le champ concerné
if (event.value == 1) {
this.getField(“Text.1”).display = display.visible;
}
else if (event.value == 2) {
this.getField(“Text.2”).display = display.visible;
}
else if (event.value == 3) {
this.getField(“Text.3”).display = display.visible;
}
this.getField(“Text”).display = display.hidden;
// ensuite on affiche le champ concerné
if (event.value == 1) {
this.getField(“Text.1”).display = display.visible;
}
else if (event.value == 2) {
this.getField(“Text.2”).display = display.visible;
}
else if (event.value == 3) {
this.getField(“Text.3”).display = display.visible;
}
3.
Ça ne sert à rien d’incorporer l’Arial, c’est une police “standard” qui est forcément déjà installée. Ça ne fait qu’alourdir le document.
:Smiley15: