How To Use Triggers To Run Javascripts In PDF Forms

You can use triggers to run javascripts in PDF forms. You can also run javascripts in PDF forms that will run when the document is opened. The steps follow:

In order to edit the PDF document I used Adobe Acrobat DC. This is not a free app but I think Google has a free app and their are other apps out there for editing PDF documents, however I’m not sure of the capabilities.


Be aware that buttons, form fields, radio buttons and similar features are called “fields” in the system. In the form I modified, I created a button field to send the form data over the Internet to our website where a WordPress plugin was waiting to process it.

  • In Tools, Prepare Form: double click the “field” to open up the Properties UI
  • Visibility controls are on the General tab, Common Properties section
  • The field name, for programming purposes, is on the General, Name tab, and NOT the misleading Options, Label tab
  • Several Actions and Triggers are available in the Actions tab
  • An Action is matched with a Trigger
  • “Mouse Up” is the trigger for the completion of a successful mouse click
  • Action: Run a Javascript or Submit a form were the two useful features

Submit a form

  • Submit a form, URL: is the target URL for the form when the user clicks the Send button. The target location must have some sort of processing feature or script that is designed to accept and process the form data. We have a free plugin available for WordPress named PDF Form Receiver with many options included
  • The Submit a form action also has a few formats available. Our free WordPress plugin handles HTML and PDF. HTML setting sends the HTML formatted data. The PDF setting sends the form data as a PDF file attachment


The Actions system is trigger-based. Now there are instances where you may need to run a javascript within a PDF form automatically when the PDF form is opened, not when something fires a trigger. This is called a Document-level Javascript.

Document-Level Javascript

  • Tools, Action Wizard, Create a New Action, More Tools, Document Javascripts. Fill out the name and description, then Save
  • In the Document Javascripts, you can edit and create your javascript. Do not begin the javascript with a function or it may cause adverse effects
  • Close and Save, then open the PDF in the free Adobe Reader app to test your javascripts


Can Not Open PDF Documents with Adobe Reader From Internet Explorer Browser

Can Not Open PDF Documents with Adobe Reader From Internet Explorer Browser

We’ve run into some client machines that have had  trouble opening PDF documents from within a browser.

Typically this is because there is an older version of Acrobat or Acrobat Reader that is or was installed on the computer and the browser has some sort of corrupt reference to it.

To correct this problem follow these steps.

  1. Open up Each version of Acrobat Reader or Acrobat that you have on your system.
  2. Go to Edit -> Preferences -> Internet and make sure the box to  Display PDF in browser is unchecked.
  3. Click OK and close Acrobat or Acrobat Reader, proceed to the next step once you have done this for all versions
  4. Open the latest version of Acrobat Reader
  5. Go to Edit -> Preferences -> Internet and check the Display PDF in browser box.
  6. Save and Close Acrobat Reader.

You should now be able to open PDF files from within your browser.

In some cases the error will occur again after an Adobe update to the software. I cant explain this but if you uncheck the Display PDF in browser box and save the setting in the MOST RECENT version of Acrobat Reader last,  this  seems to allow PDF documents to open in the latest Adobe Reader version outside of the browser which may have some “corrupted” internal mapping to the incorrect version of the older Acrobat version.


Call Now Button(208) 344-1115


Join our email list

and get your free whitepaper