Skip to main content
Participant
April 5, 2017
Question

JavaScript is enabled but form field scripts are not working in Adobe Reader DC

  • April 5, 2017
  • 3 replies
  • 1020 views

Hi.

I've designed a very simple form in Acrobat Pro DC, with a bit of JavaScript, which is intended to handle risk evaluation in program management.

The functionality works in the following applications installed at my organization: Acrobat Pro DC; Acrobat Standard 11; Adobe Reader 11.

My client is using Adobe Reader DC, with JavaScript enabled, but none of the script functions at all - neither the Calculate scripts nor the Mouse Up actions.

There is a grid composed of 25 squares (for which I'm using a radio button, "Current_Risk", with 25 choice elements); there are two associated dropdown fields, "Current_Likelihood" and "Current_Consequence". The choices are labeled by likelihood and consequence - for instance, L5C1, or L2C3.

Setting both Current_Likelihood and Current_Consequence sets the value of Current_Risk, selecting one of the radio button choices.

Clicking on one of the radio button choices sets the appropriate likelihood and consequence ratings in the drop downs.

There's also a button that resets both the radio button and the two dropdowns.

The code in Current_Consequence's calculate script is:

var Current_C = event.value;

var Current_L = this.getField("Current_Likelihood").value;

this.getField("Current_Rating").value = "L"+Current_L+"C"+Current_C;

The code in Current_Likelihood's calculate script is similar:

var Current_L = event.value;

var Current_C = this.getField("Current_Consequence").value;

this.getField("Current_Rating").value = "L"+Current_L+"C"+Current_C;

The code in the radio button elements' "Mouse Up" action looks like this (for L5C1):

this.getField("Current_Likelihood").value = 5;

this.getField("Current_Consequence").value = 1;

Finally, there's a button with this code in "Mouse Up":

this.resetForm(["Current_Rating","Current_Likelihood","Current_Consequence"]);

As you can see, it's all very simple.

Does anyone know why this might be functional for some installations of Reader but not others?

Thanks very much!

This topic has been closed for replies.

3 replies

Inspiring
April 5, 2017

I just read through your script in detail, and it doesn't make a lot of sense to use calculate scripts like you are in the Current_Consequence and Current_Likelihood fields. It would seem to make more sense to set all of the various field values in the Mouse Up scripts of the radio buttons, but without knowing more about how the form is intended to work I can't say much more.

Inspiring
April 5, 2017

Could JavaScript be disabled in Reader's preferences? Have you tried something simpler as a test, such as a document with a button that has a Mouse Up script like:

app.alert("JavaScript is enabled.");

Inspiring
April 5, 2017

It would be helpful is you posted a link to an example form rather than having others try to reconstruct your form. Also there could be some code not shown that is causing the issue.

S@CAuthor
Participant
April 6, 2017

The form should be downloadable here:

Risk Information Form

I'm also having the clients try a test file with an app.alert() in a button MouseUp event; I'll report the results when I get them.

Thanks for helping.

try67
Community Expert
Community Expert
April 6, 2017

There are errors in your code, even in Acrobat. Click one of the Current Rating buttons and check the JS Console.