Skip to main content
Participant
October 10, 2019
Question

populate form fields through Javascript

  • October 10, 2019
  • 1 reply
  • 435 views

Hi,

 

the script below works fine when I run it from the console in Adobe Acrobat DC.

var v = this.getField("A0-Name1");
var myDoc = app.openDoc({cPath: "/C/UserData/user/Documents/A1-template.pdf", bHidden: false});
myDoc.getField("A1-Name1").value = v.value;

However when I trigger it through a button I get the Error:

 

TypeError: myDoc is undefined

3:AcroForm:A1button:Annot1:MouseUp:Action1

 

any Ideas?

thanks!

    This topic has been closed for replies.

    1 reply

    Bernd Alheit
    Community Expert
    Community Expert
    October 10, 2019

    Have you set the disclosed property of the document?

    Participant
    October 10, 2019
    That was quite simple .. sorry I'm new to this. Thanks for the answer 🙂