abracadabraPDF › Forums › PDF – Général › Remplissage de 2 champs par une valeur issue d’un menu déroulant › Répondre à : Remplissage de 2 champs par une valeur issue d’un menu déroulant
Résolu
var aParams = [
{cName: “Lincoln”, oSubMenu: [
{cName: “Abraham”, cReturn: “Abraham|Lincoln”},
{cName: “Mary Todd”, cReturn: “Mary Todd|Lincoln”},
{cName: “Robert Todd”, cReturn: “Robert Todd|Lincoln”},
{cName: “Edward Baker”, cReturn: “Edward Baker|Lincoln”},
{cName: “William Wallace”, cReturn: “William Wallace|Lincoln”},
{cName: “Thomas”, cReturn: “Thomas|Lincoln”}
]
},
{cName: “Buffett”, oSubMenu: [
{cName: “Jimmy”, cReturn: “Jimmy|Buffett”},
{cName: “Jane”, cReturn: “Jane|Buffett”},
{cName: “Savannah Jane”, cReturn: “Savannah Jane|Buffett”},
{cName: “Sarah Delaney”, cReturn: “Sarah Delaney|Buffett”},
{cName: “Cameron Marley”, cReturn: “Cameron Marley|Buffett”}
]
}
];
var resp = app.popUpMenuEx.apply(app, aParams);
// Populate the fields with the selected values
if (resp) {
var names = resp.split(“|”);
getField(“name”).value = names[0];
getField(“surname”).value = names[1];
} else {
getField(“name”).value = “”;
getField(“surname”).value = “”;
}