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

Question about tables and division

StalnakerJ
Registered: Jun 28 2009
Posts: 8

Hello!

I hope someone can help me with the following issue. I have tried everything I know.

I am working on an Evaluation form.

I need to divide the one sum by another sum.

I have a table with 10 rows and 4 columns ( the table is populated with answers from questions on the form). I can get the table to populated correctly.

Issue:

I need to divide the sum of one of the columns(lets call it "pointtotal") with the sum from another column (lets call it "questions" answerd").

I used the "/" sign in my formula and continue to get an error. It seems so easy, but I can not make it work.

Anyhelp or get me pointed in the right direction would be greatly appreciated.

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There are many errors for any field, and multiple fields can multiply the occurrence of the errors being reported as the fields in error are referenced by other fields.

What is the exact wording of the error?

If there is data, does the error occur?

An obvious error is division by zero or a null (non-displayed zero) value. Have you provided control statements to prevent this situation?

George Kaiser

StalnakerJ
Registered: Jun 28 2009
Posts: 8
Sorry for the lack of details about the error. I did not have the "exact" error on me when I put the question out there. I am new to this, so I am sure that I am missing something.

Thank you for your reply.

I have tried several other ideas that I received on this forum this morning and now I do not have an error, but I still cannot get the form to work.

Issue: I used the answers to the questions(10 questions in all) to populate the table. I have a total for the “POINTS” at the bottom of the table and I have totaled the “Items Evaluated”. What I need to do is get the answer (“POINTS” / “Items Evaluated") and multiply it by 3.

So, it would be “POINTS” / “Items Evaluated” * 3 to get the Overall Average.

Example: Say that the employee made all “3”’s on their evaluation, with the exception of one item, and on that one they made a “2”. The results would be 29/30, which would be a 2.9.

I need the 2.9 to go in the “Overall Average” field.

Currently, the form is not giving me an error, but the “Overall average” is always 3. I still can not make it populate 2.9.

Below is what I have in the "Overall Average" calculate:

if(HasValue(xfa.resolveNode("#field[2]"))) then
xfa.resolveNode("#field[1]")/ xfa.resolveNode("#field[2]") * 3
else
null
endif
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So are all your fields named "field"? You really ought to be using proper names for your fields. And why are you using the "resolveNode" function? Was this just because you are new to LC scripting and copied some code? This function is totally unnecessary. You can reference the fields directly by thier names. This would make the form much easier to develop and debug. Take a look at this video:

https://admin.adobe.acrobat.com/_a200985228/p87746471/

There are other videos and articles that will help get you going with scripting LC forms.

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]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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