Skip navigation
Maribethlm
Currently Being Moderated

Basic calculations in LiveCycle

Apr 7, 2011 11:28 AM

I'm trying to create basic calculations in a form that I am creating in LiveCycle Designer. Has anyone does this, and can you please give me some help? I don't understand the instructions in the Help feature or the book that I have.  Here is what I am trying to do:

 

Text Field A 100 (manual entry)

Text Field B 75   (manual entry)

Text Field C 25   (Result of calculation of A - B = C)

 

Then:

 

Text Field D 2    (manual entry)

Text Field E 50  (Result of calculation of C X D = E)

 
Replies
  • Currently Being Moderated
    Apr 7, 2011 11:44 AM   in reply to Maribethlm

    I prefer to use Javascript so on the Calculate event of the C field you would use this command:

     

    this.rawValue = FieldA.rawValue -Field B.rawValue

     

    Then on E Field's calculate event you woudl use this command:

     

    this.rawValue = FieldC.rawValue * FieldD.rawValue

     

    If you woudl prefer to use FormCalc you woudl still use the Calculate event and on FieldC the command woudl be:

     

    FieldA - FieldB

     

    On the calculate of Field E

     

    FieldC * FieldD

     

    Hope that helps

     

    paul

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2011 4:25 AM   in reply to Maribethlm

    There is a native javascript function to get the absolute value of a number .....lets assume your fields are called Field1 and Field2. Then the command woudl be:

     

    Total.rawValue = Math.abs(Field1.rawValue - Field2.rawValue)

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2011 9:19 AM   in reply to Maribethlm

    Works fine for me ...here is a sample ...the code is on the calculate of the total field. Oh ....and make sure your fields are numeric.

     

    Paul

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2011 9:40 AM   in reply to Maribethlm

    Nope .....did you set the language to javascript?

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2011 10:03 AM   in reply to Maribethlm

    Email it to LiveCycle8@gmail.com . Please include a description of the issue.

     

    Paul

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points