Hello,
I'm in a pickle. I have a deadline for a form that needs some Javascript, but I've no idea how to achieve the desired result.
I need for a person to put in a value for 2008, then one for 2007, have Acrobat calculate the change (difference) between the two values as a positive or negative percentage with no decimals, and have that new value appear in the third field.
What I mean is that I need for this to happen:
User types in Value 1 in Field2008, then Value 2 in Field2007, and Acrobat automatically shows the difference as + or - XX% in FieldChange.
So if Field2008 has "200" and Field2007 has "150" then Field 3 automatically calculates and shows "+33%" (an increase of 50 from 150 is a positive increase of 33%, right?)
I have no idea where to get the script for my FieldChange to make this happen.
Thanks!
Alex Adams
var v1 = getField("Field2007").value;
var v2 = getField("Field2008").value;
event.value = Math.round( 100 * (v2 - v1) / v1);
If you're using Designer, you should be able to adapt this.
George