Hello everyone!
This is my first time to create a form using livecyle. I never knew form created in designer was different from acrobat. Thanks to George_Johnson for pointing that out.
I happened to create my form in livecycle so here I am hoping someone can help me with my problem with the calculation of average using checkbox values. Simple calculation would just be:
average = the sum of checkbox values / the count of the rows.
I have 4 checkboxes (set to global and having the same field name) in a row and 7 rows. However, not all 7 rows may be answered therefore throwing off my calculation because my denominator remains 7.
I was given a javascript (for loop) but it did not work. Is there a way to calculate the average making the denominator a variable wherein a condition is set to count only the checkboxes that are checked or which values are not zero? If so, please help me with the codes.
Thank you in advance.
Cheska
Anyway, all you have to do is put a counter in the "sum" loop. If a value is 0, then don't increment the counter. To get the average, divide the sum by the counter. I think that George already pointed this out in your previous thread.
To provide more info you'll have to explain a bit more about your form. For example, what are the names of the fields and how are they organized in subforms?
You can learn more about using LiveCycle to create forms, and scripting in particular from this video:
https://admin.adobe.acrobat.com/_a200985228/p87746471/
You'll find more video tutorial on this at www.pdfscripting.com.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script