LiveCycle - Dropdown text value to be calculated in repeatable Subform

PCForm

28-10-2015

Hello,

I have a dropdown with two text selections (Account, Survey) in a repeatable Subform. 

Then I have two fields adding the selections.  # of Accounts per Region____  # of Surveys per Region ___.

If I add 10 repeatable rows selecting Account 6 times and Survey 4 times, how to write the script or form calc to sum the selections?

Dropdown.JPG

Thank you!



Accepted Solutions (1)

Accepted Solutions (1)

_Bruce_Robertson

MVP

29-10-2015

Hi,

You'll probably have to change the code to suit your field names and form structure but this JavaScript should do it in the calculate event of the “# of Account/Survey Reviews per Region” fields

xfa.resolveNodes('Table1.Row1.[ReviewType == "Account"]').length;

and

xfa.resolveNodes('Table1.Row1.[ReviewType == "Survey"]').length;

Here’s a sample to make sure of the code, https://sites.google.com/site/livecycledesignercookbooks/home/PCForm.pdf?attredirects=0&d=1

Regards Bruce