These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Adding a field that calculates total "No" radio button answers??

jkilli
Registered: Sep 12 2008
Posts: 18
Answered

I have created a form with several "yes" and "no" answers using radio buttons. At the bottom of the form I wanted to add a "read-only" field that is automatically calculated based on all the "no" answers. Specifically, I would like to do the following:

Have a field at the bottom of the form that calculates the total number of "no" (radio button) answers. This field would be "read-only" so the user completing the form cannot change it.

Any help?!?! PLEASE!!!

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You will have to write a custom calculation script and depending upon how you named your radio buttons and what values you assigned to the export value of the No buttons will determine how the script will be written.

Assuming you named all your radio button groups "RadioButtonList" and the value for no is "2", you will have a calculation script for the number field like:

var Count = 0 // clear count
if(RadioButtonList[0].rawValue == 2) then Count = Count + 1 // check group 1
endif
if(RadioButtonList[1].rawValue == 2) then Count = Count + 1 // check groupe 2
endif
$.rawValue = Count // report total

George Kaiser

jkilli
Registered: Sep 12 2008
Posts: 18
Thanks...can someone provide actual examples of what the script would look like for me. That's the part I am having problems with. Thanks!
jkilli
Registered: Sep 12 2008
Posts: 18
Oh my god...I am so excited!!! I had about 45 fields to calculate but it worked!! Thank you so MUCH!!!!