Hi, I need help creating a calculation field that would find the percentage of values obtained from radio button groups in acrobat 9.0.
I basically have ten radio button groups (ODIO1, ODIO2, ODIO3, ODIO4, ODIO5, ODIO6, ODIO7. ODIO8, ODIO9, ODI10). They
each have six radio buttons/chocies that correspond to button values of 0,1,2,3,4, and 5.
I essentially need a calculation field that would display the percentage of the groups with the equation = (SUM(ODI01 - ODI10)/50) * 100%.
This would give me a value from 0-100%.
I have little experience in using Javascript, so any help in creating a Javascript to use this equation is greatly appreciated.
Thank You!
If you're using a percentage field the result needs to be a number between 0 and 1, not 100...
Anyway, this code replicates your formula:
var total = 0;
for (var i=1; i<=10; i++)
total += +(this.getField("ODIO")+i).value;
event.value = (total/50) * 100;
Thanks for the feedback.
I understand what you mean with getting a formula with a value between 0 and 1. How would I need to change the formula to do this?
Also how can i factor into the "total" line the sum of the total value of all the radio buttons groups?