on 07-05-2011 4:04 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.