Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Total specific fields for a Total Field

Avatar

Level 1

I am creating an application for a scholarship and there is a section for financial information asking for annual income of parent, spouse, etc.

At the bottom of the form I have a feild for the total amount of parent, spouse, etc. Each feild has a different name. How do I get the Total Feild to total the previous fields?

2 Replies

Avatar

Former Community Member

On the Total Field write javascript on the Calculate event that will add each of the individual fields up. You will want to use the fieldname.rawvalue to get the value of the field back. The formula would look something like this:

this.rawValue = Field1.rawValue + field2.rawValue + .......

Paul

Avatar

Level 1

Thanks Paul for your answer. I have

a problem.

1st. I typed the script in for the first four fields and everything worked fine. I cleared what I typed in and started over typing in the rest of the fields and the caculated feild would not show anything. I cleared out again and typed: this.rawValue=   and then I held down ctrl and clicked on the first field then typed .rawValue+ and clicked on the next feild and so on till I got to the 7th feild then this is what it started doing:

this.rawValue=ExAssisSchYr.rawValue+ExpdAssisForYear.rawValue+ExpdAssisForYearPrts.rawValue+ExpdAssisForYearOther.rawValue+SchoolLoans.rawValue+Scholarship1.rawValue+xfa.resolveNode("Scholarship2[1]")


I highlighted the problem blue. There are a total of 12 feilds that need to be totaled.

Thanks

Michael