Skip to Content

how to calculate sum of the fields in adobeforms

Hello Experts

can  i know how to calculate sum of fields in the adobe form.  I have few fields to be summed in total field.

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 17, 2014 at 07:37 PM

    Hello Surendra,

         Suppose you are having 4 fields and the 4th field is the TOTAL field.

         Write the below Javascript on the Initialize event of TOTAL field as shown below.

    Remember that if you use just "+" sign without Number() or ParseInt() function it acts like String Concatenation.

    this.rawvalue = Number( this.parent.field1.rawvalue ) +

                          Number( this.parent.field2.rawvalue ) +

                          Number( this.parent.field3.rawvalue ) ;

    You can also write is as shown below.

    this.rawvalue = parseInt( this.parent.field1.rawvalue ) +

                             parseInt( this.parent.field2.rawvalue ) +

                             parseInt( this.parent.field3.rawvalue ) ;




    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 17, 2014 at 06:50 PM

    you can use java script to calculate the sum.

    You can use script like this in initialization event of the field where you want to show the total.

    this.rawValue = root.node.field1.rawValue+root.node.field2.rawValue

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Surendra,

           Remember that if you just use "+" sign, it acts like String Concatenation. To add the values of fields, you have to use either of Number() or ParseInt() function. Then it calculates with respect to Integer.