Javascript Sum

Avatar

Avatar

msmitty52

Avatar

msmitty52

msmitty52

11-01-2011

Hi,

I need to have a field in a form that sums the data entered by the user in 5 other fields, and one defined field.  It's super easy to do in Acrobat 9.0, but I need to create the form in LiveCycle and the JavaScript wont transfer from Acrobat to Livecycle.  Here is what I have and it isn't working:

AFSimple_Calculate("SUM", new Array ("LineCalc1", "LineCalc2", "LineCalc3", "LineCalc4", "LineCalc5", "StudentLoan"));

A separate field needs to subtract the value from that calculation from 30,400:

event.value = ( 30400 -
    this.getField("Total_Proposed_Payment_Toward_Tuition_Room_and_Board").value )

I am a complete beginner at JavaScript.  I have tried to figure this out, but I really just don't know where to go! Please help! Thank you.

View Entire Topic

Avatar

Avatar

gkaiseril

Avatar

gkaiseril

gkaiseril

12-01-2011

You are using Acrobat Form Tool code, so unless you are making your form with Acrobat, I would use the syntax and languages of LiveCycle Designer.

Look in the scripting reference for the 'Sum' function and examples of how to write equations in LiveCycle Designer. The 'Scripting Reference' is under LiveCycle Designer's "Help" menu option.