Skip to main content
Participating Frequently
April 6, 2018
Question

Java script in form not functioning always

  • April 6, 2018
  • 1 reply
  • 629 views

I have a form that has several calculated fields, it works fine in Acrobat Pro, but very hit and miss in other programs. The form is an insurance application and it calculates the premium dependent on the "State" and the "Deductible" ("ded_1"). In Mac, the whole form seems broken, not just the formulas, but the layout too.

I'm having issues with one particular field "ded1".

The options of a drop down list field "ded1" is dependent on the data input of another field "State1". i.e. you input 'mi' it changes it to 'MI' and sets the options in 'ded1' to $5,000 & $7,500. you input any other state it converts it to upper case and sets 'ded1' to $2,500

I've placed this code in the 'Validate' tab of the 'State1' field.

event.value = event.value.toUpperCase();   // Sets the entry to upper case.

// Sets the options for the deductible field.

switch (event.value) {

    case "":

        this.getField("ded1").setItems([""]);

        break;

    case "MI":

        this.getField("ded1").setItems(["$5,000","$7,500"]);

        break;

    default:

        this.getField("ded1").setItems(["$2,500"]);

        break;

}

The pdf can be viewed here

https://www.statesideapm.com/bi-application-pdf

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 6, 2018

Unless that other program is Adobe Reader you should report this issue to the developers of these programs. It has nothing to do with Adobe.

Participating Frequently
April 6, 2018

Thanks, for replying so quickly.

It certainly doesn't work on Adobe Reader on Mac. Nor in browsers.

Do you think it might help if the formula were in the 'ded1' field rather than the 'State1" ?

Obviously it would need to be different.

try67
Community Expert
Community Expert
April 6, 2018

What version of Reader are you using?