Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Calculating total in checkboxes

Avatar

Level 3

I am trying to create a pdf form which can calculate the checked boxes predefined values in to a TOTAL field. I tryed to upload the pdf file sample but forum not allowing it. Please refer the screenshot.

Kind regards

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Assuming the airconditioning checkbox is called AirConditioning and the number of hours called AirConditioningHours and the project system checkbox is called ProjectionSystem.

Try this JavaScript code in the calculation event of the total field;

var total = 0;

if (AirConditioning.rawValue == 1)

{

    total += AirConditioningHours.rawValue * 4;

}

if (ProjectionSystem.rawValue == 1)

{

    total += 15;

}

this.rawValue = total;

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

Assuming the airconditioning checkbox is called AirConditioning and the number of hours called AirConditioningHours and the project system checkbox is called ProjectionSystem.

Try this JavaScript code in the calculation event of the total field;

var total = 0;

if (AirConditioning.rawValue == 1)

{

    total += AirConditioningHours.rawValue * 4;

}

if (ProjectionSystem.rawValue == 1)

{

    total += 15;

}

this.rawValue = total;

Regards

Bruce