Many Calculations Causing Form to Pause


i have created 6 page qc form rankings in adobe acrobat xi.  there 20 sections approx 11 questions in each section.  each question dropdown choices na,1,2,3.  associated export values 0,3,3,3.  have 3 calculations after each section - points possible, points earned, percentage.

 

points possible example:

event.value = this.getfield("misc1").value + this.getfield("misc2").value +this.getfield("misc3").value +this.getfield("misc4").value +this.getfield("misc5").value +this.getfield("misc6").value +this.getfield("misc7").value +this.getfield("misc8").value +this.getfield("misc9").value +this.getfield("misc10").value;

 

points earned: simple sum of fields in section (e.g. misc1, misc2, etc)

 

percentage example:

var numerator = +getfield("points earned_18").value;

var denominator = +getfield("points possible_18").value;

event.value = denominator !== 0 ? numerator / denominator : "";

 

i have total calculation points possible, points earned, , percentage.  have checked calculation order , correct.  when run form have wait 5 seconds when moving between each drop down field whole form trying calculate.  suggestions?

you may have optimize calculations.

 

scripting languages interpret each action when encountered , done each time script encountered. means each line syntax checked, converted execution tokens , tokenized object executed. if 1 uses document level functions or without parameters, syntax checking , tokenization done once.

 

i @ creating sum function sum passed fields or field values.

 

also putting using 1 field perform calculations  can speed things eliminating need read code each field needs calculation.

 

you might improve speed using hierarchical field names getting field objects field names reduced getting parent field , creating array of children field objects instead of getting each field name.



More discussions in PDF Forms


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop