cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive calculating in a Adobe Form

Former Member
0 Kudos

Hello,

I would like to calculate the amount of some fields. But these values don´t exist in Back-End and the user should type them after creating the Form in some Fields if it. Now I´m trying to create a Script with JavaScript which calculates the sum of these values, before printing or saving this form.

I tried to use the Change-Event, but this wasn´t successful. Has anybody some ideas, how i can solve this issue? Operations like zelle2s.rawValue = xfa.event.fullText don´t work proberly.

Best regards

Benjamin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Your requirement is not clear to me. Please check the following logic.

Assume that you have three fields A, B and C. Requirement is to add A and B and store the sum in C.

Use the following script in the 'CALCULATE' event of C.

this.rawValue =  Number(A.rawValue) +  Number(B.rawValue);

Regards,

Sanoosh

Former Member
0 Kudos

You can try the script at the EXIT event of both the fields.

Thanks,

Aravind

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey,

thanks for your answers. I use the calculate script with this code:

this.rawValue = Number(zelle21.rawValue) + Number(zelle22.rawValue);

But this doesn´t work properly. The special feature of the calculation is that the numbers are entered by the user. So after generating the form the user enters the values​​, then this values should be summed. So I do not know whether the event is correct

But in the exit event, I'll already have a total charge for another field, by example:

zelle56.rawValue = parseFloat(zelle26.rawValue) + parseFloat(zelle36.rawValue);

I thought this event could still charge you an additional sum. But this can only seem to enter one script.

Have you any ideas that might help?

Best Regards

Benjamin

Former Member
0 Kudos

You can try the script at the exit event of 'zelle21' and 'zelle22' field. In the exit event of these fields it does not make sense

to calculate other fields though you can have additional script here. I dont see any issue here.

Thanks,

Aravind