Skip to main content
Participant
March 31, 2020
Question

Dialog Box Button Help

  • March 31, 2020
  • 3 replies
  • 328 views

Okay so I'm new to programming within adobe acrobat. Im trying to execute a function once the ok button is clicked in the dialog box. 

the button is created in json.

which it looks like 

{
type: "ok",
ok_id: "SubButton",
ok_name: "Submit",
value: Submint(),
alignment: "align_right",
}

I have no Idea how to even attempt this ive tried googling but coming very short all the time. 

This topic has been closed for replies.

3 replies

Thom Parker
Community Expert
Community Expert
March 31, 2020

Well, you need a whole dialog object definition and a script to make that work. Is this just a slice of you're complete code?

There are two functions you can define in the Dialog Object that are run after the OK button is pressed, commit and validate.  However, you may want to run your function after the dialog exits with a status code of "ok" rather then on the ok button itself. 

What exactly are you trying to accomplish?

You'll find an online dialog object designer (paid for), as well as examples, and some video tutorials on creating dialogs, Here:

https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
ls_rbls
Community Expert
Community Expert
March 31, 2020

Hi,

 

Can you elaborate more what are you trying to achieve when the button is pressed?

 

What exactly is the action that you need to execute?

Bernd Alheit
Community Expert
Community Expert
March 31, 2020

What happens when you use the button?

Ihave never seen a property with the name "ok_id".