Java script in form not functioning always
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
