Script to calculate fields

Avatar

Avatar

anthony_willia2

Avatar

anthony_willia2

anthony_willia2

04-05-2016

I am new to LifeCycle Designer and need a field to show the sum of checkboxes i select throughout the form.  Can anyone please assist?

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

SI_MSD7

Avatar

SI_MSD7

SI_MSD7

04-05-2016

There are several ways to accomplish this depending on the design/layout/structure of your form.

One simple way is by using 3 different check boxes with different names, and a numeric field to display the sum. NOTE: all fields in this example are contained within the same subform:

Check box field names (NOTE: the export value of each check box is equal to "1" when checked, "0" if unchecked):

Checkbox1

Checkbox2

Checkbox3

Numeric field name:

TotalField

FormCalc script on TotalField, using "calculate" event:

$ = Sum(Checkbox1,Checkbox2,Checkbox3)

OR

Javascript script on TotalField, using "calculate" event:

this.rawValue =  Checkbox1.rawValue + Checkbox2.rawValue + Checkbox3.rawValue;

As mentioned, there are several ways of accomplishing this task. The above is a basic approach.

Hope this helps.