Skip to main content
Inspiring
May 9, 2017
Answered

Javascript not working

  • May 9, 2017
  • 2 replies
  • 16113 views

Hello everyone,

I created a form with some JavaScript functionality. It works in Adobe Acrobat DC, but it doesn't work in Reader on our company website.

Is there a reason for this?

Thanks,

Jake

This topic has been closed for replies.
Correct answer Joel Geraci

Yes I've just checked on Chrome and Explorer.

However, I have just found out that the JavaScript actions are no longer on the form fields.

Is there any way this could have happened, other than someone doing it manually?

My original PDF has the JavaScript action. I sent it to our Marketing department to put on the website and now the JavaScript actions aren't there.


I’m going to guess that the marketing department opened it in Preview on OSX and then saved the file… or inadvertently saved it after some minor change. Preview... without warning... removes scripts from PDF form fields every chance it gets.

J-

2 replies

try67
Braniac
May 9, 2017

What kind of "functionality"?

Inspiring
May 11, 2017

All I am doing is adding JavaScript to form fields:

function check () {

//Foot Options is the name of the radio button group

//Javelin is the name of the radio button

//If the selected radio button isn't called Javelin

if(this.getField("Foot Options").value != "Javelin"){

//Don't allow both to be selected

this.resetForm("Top Housing");

}

}

check();

New Participant
May 23, 2017

Do you have a TARDIS? I learned it over the course of 20 years.

Though a good place to start is pdfscripting.com


LOL - my TARDIS has been on the fritz.

Thanks for the link - I'll see if I can figure it out. Unless you're for hire and could teach this?

Bernd Alheit
Braniac
May 9, 2017

Acrobat Reader doesn't support all JavaScript features.