AcroDialog : how to select the value of a field ?
I would like to use an AcroDialog window for updating a field in a PDF form and I need to populate an "edit text" with the value of the field "Text1" existing in the form. How the following script must be modified to do so ?
Probably very simple... but I stumble on the solution.
Many thanks in advance for your advices
////////////////////////////////////////////////////////////////
// Acrobat JavaScript Dialog
//
var oJSDlg = {
strEdt1:null,
initialize:function(dialog){
},
validate:function(dialog){
var bRtn = true;
var oRslt = dialog.store();
return bRtn;
},
commit:function(dialog){
var oRslt = dialog.store();
this.strEdt1 = oRslt.Edt1;
},
description:{
name:"Dialog Box",
elements:[{type:"view",width:634,height:405,elements:[
{
type:"static_text",
item_id:"Sta2",
name:"Veuillez saisir le texte du message :",
},
{
type:"edit_text",
item_id:"Edt1",
width:614,
height:306,
multiline:true,
},
{
type:"ok_cancel",
},
]}]
}
}
if("ok"==app.execDialog(oJSDlg))
{
console.println("strEdt1 = "+oJSDlg.strEdt1);
}
