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

form calc drop-down list

shahal
Registered: May 3 2007
Posts: 43

I am creating an attendance form. I have several drop-down lists with the text values of "p" "a" and "l". Each of these letters has a value of 1.
I also have 3 numerical fields. I would like a form calc or java script that would add up all the values of only "a" and place it in numerical field 1, then add up all the values of only "b" and place it in numerical field 2, and so on.
Please help.

My Product Information:
Acrobat Pro 7.0.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Without knowing the hierarchy of your form it would be difficult to give you anything specific. But here is the basic idea.

1. Don't use an export value in the list
2. Get a collection of all of the drop down lists
3. Loop through the collection to build the 3 sums.

If the drop-downs are all named "MyDropDown" then the code could look like this

var sum1 = 0,sum2=0,sum3=0;var listNodes = xfa.form.form1.resolveNodes("P1.MyDropDown[*]");for(var i=0;i

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script