I am trying to add five different text fields together without using the easy add so I can force a recalculate. I am having a problem adding the fields together and have it output the sum of the fields. Two of the five fields have if statements so that if another field on the form changes these fields will change and when these change the field that has the total should change but it doesn't. My way to fix this was to just write a simple sum script so I could force recalculate. The problem I am having is getting the sum to calculate correctly.
This is the code I have right now and it is giving me a NaN in the total field:
var a=this.getField("CON Base");
var b=this.getField("CON R");
var c=this.getField("CON E");
var d=this.getField("CON B");
var e=this.getField("CON P");
event.value = a.AsNumber+b.AsNumber+c.AsNumber+d.AsNumber+e.AsNumber;
Anyway you can help with writing a correct sum script or a better way to get the total field to readjust immediately after the if statement would change the CON R or CON B field.
This is what the field looks like:http://i175.photobucket.com/albums/w127/gb82790/script.png
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com