Expand my Community achievements bar.

Number Field Calculations... With a Twist

Avatar

Former Community Member

Greetings,

I am using LiveCycle Designer ES3, and am trying to perform the following actions within a downloadable PDF form:

If total value of Field4+Field5+Field6+Field7 is not less than or equal to value of Field3, then pop up an error message and reject the value in Field3. 

Here's the twist though:  There can be multiple amounts of Field7 as Field7 is an "Other" type of field.  When the form is initialized, the form defaults to just one Field7, however the user can click "Add Another Row" and, voila, another Field7 appears.  The amount of rows containing a Field7 value is technically infinite, however generally there will be at most only three rows.  Is it possible to create a script to account for this variable? 

Thanks in advance for your help.

-Clint

2 Replies

Avatar

Level 10

Hi,

You can use wildcards in FormCalc to match every instance of repeated objects.

So if the row named "Row" is repeatable and contains a cell named "Field7", then the script could look like this.

if (Sum(Field4, Field5, Field6, Table.Row[*].Field7) eq Field3) then

     $host.messageBox("Warning...")

endif