Copy link to clipboard
Copied
Inspired by other, I created this dialog box to populate dynamic stamp. I would like to replace first field "Projet" by a list of value I can code in the script. Can anyone help on that ?
if (event.source.forReal && (event.source.stampName == "#stamp1")) var JSADMDlg1 = { result: "cancel", DoDialog: function() { return app.execDialog(this); }, Projet: "txt1", TVA: "txt2", initialize: function(dialog) { var dlgInit = { "txt1": this.Projet, "txt2": this.TVA, }; dialog.load(dlgInit); }, commit: function(dialog) { var oRslt = dialog.store(); this.Projet = oRslt["txt1"]; this.TVA = oRslt["txt2"]; }, description: { name: "JSADM Dialog", elements: [{ type: "view", width: 254, height: 351, elements: [{ type: "view", width: 236, height: 354, char_height: 10, elements: [{ type: "static_text", item_id: "sta1", name: "Nom du Projet", }, { type: "edit_text", item_id: "txt1", variable_Name: "Projet", width: 131, height: 23, char_width: 8, }, { type: "static_text", item_id: "sta2", name: "TVA", }, { type: "edit_text", item_id: "txt2", variable_Name: "TVA", char_width: 8, }, ] }, { type: "ok_cancel", width: 64, height: 23, }, ] }, ] } }; JSADMDlg1.Projet = ""; JSADMDlg1.TVA = ""; if ("ok" == JSADMDlg1.DoDialog()) { this.getField("Projet").value = JSADMDlg1.Projet; this.getField("TVA").value = JSADMDlg1.TVA; }
Copy link to clipboard
Copied
You can use a list_box for this.
You can find an example in the Acrobat Javascript Reference.