cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate the Total

Former Member
0 Kudos

Hi,

I am very new to the java script language. Currently working on adobe forms.

In the form there are 5 currency fields and one calculate button is there.

When the calculate button is clicked, all the 5 currency fields should be summed up

and would be displayed in the field total. How to write the java script for this.

Please help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the exit event of the button, just write code like this.


Total.rawValue = Field1.rawValue +  Field2.rawValue + Field3.rawValue + Field4.rawValue + Field5.rawValue 

Or else, you can also use the standard function Sum (), and pass these parameters to it.

Regards

Runal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thanks for it. But in my adobe forms the library fields are from ISR Controls.

For example these are the fields:

payinlieunotice(currency field) and binding has been done to the context $record.PAY_LIEU_NOTICE.DATA[*].FIELD

benefitinlieunotice(currency field) and binded with $record.BENEFIT_LIEU_NOTICE.DATA[*].FIELD.

.

.

.

and total filed binded with $record.TOTAL.DATA[*].FIELD.

The calculate button is ISR On_Form Event and on the screen I have put also ISR_PARAM_EVENT in invisioble mode.

the java script mentioned by you is working fine for standard library elements but for ISR its not.

Please help.

Former Member
0 Kudos

Personally, I would skip the button and place the SUM code in the calculate event of your total field - that way, the total is dynamically summed anytime a value is changed and you don't have to rely on a separate button.