1

Is it possible to reference a Form or a Button on a PDF using Javascript? What I am trying to do is to write Javascript code that will submit a form, or if not that, click a Button of my choice that submits the form.

The problem I have here is that I don't know how to reference the button or the form in Javascript.

So is there a way to achieve this?

RamonaF
  • 11
  • 1
  • is that form inside a pdf ? – HasilT Jan 02 '19 at 14:23
  • Could you please provide some examples of the work you've done so far, even if it's just research, please provide something to help us aid you to find the ideal solution for yourself. – JO3-W3B-D3V Jan 02 '19 at 14:25
  • @HasilT Yes the form is inside the PDF – RamonaF Jan 02 '19 at 14:44
  • @JO3-W3B-D3V I started with the basics. Researched on how to send web requests to a webpage, for which i got a method called app.launchURL(). But it requires user-interaction. I created a normal form with a submit button pointing to my webserver and it works properly. What i now want to do is to reference this button and trigger the "click" action. – RamonaF Jan 02 '19 at 14:51

1 Answers1

1

In Acrobat JavaScript, you can not execute "click a button" as an action.

Instead you execute whatever the MouseUp event of that button has assigned. If it is a function, execute the function, if it is some lines of JavaScript code, execute those lines.

In any case, you will need a trigger event. When you have specified it, the rest is straightforward.

I also strongly recommend to have a good look at the Acrobat JavaScript documentation.

Max Wyss
  • 3,549
  • 2
  • 20
  • 26