Using LiveCycle, how do I calculate only the prices shown?

user305374

09-11-2018

Hi experts. I'm a very novice LiveCycle user and have created a form with set prices which are hidden or invisible when the "NO" box is checked and shown when the "YES" is selected. I'm having trouble figuring out how to get the total to only calculate the visible amounts. Can someone help me figure out how to script this? PLEASE, PLEASE, PLEASE HELP! If better suited for a different forum, please let me know which one. Thanks in advance for your help.

Pricing example.jpg

Accepted Solutions (1)

Accepted Solutions (1)

radzmar

MVP

13-11-2018

Well, when the form was created in Acrobat its an AcroForm which is totally different to dynamic forms created in LiveCycle Designer.

To share your form just upload it to a accessible webspace and post a link to it here.

Answers (4)

Answers (4)

radzmar

MVP

12-11-2018

Assuming your table is build this way: A repeatable row named "Row" with a Price field and a Subform containing a radio button group which can have either the value 1 (yes) or 2 (no) …

1620129_pastedImage_0.png

… the calculate event of the Sum feld can could be:

// Select prices only form those rows, where the radio button selection is 1

var oCells = Table.resolveNodes("Row.[Subform.RadioButton eq 1].Price"),

iSum = 0;

// Add all found prices together

for (var i = 0; i < oCells.length; i += 1) {

    iSum += oCells.item(i).rawValue;

}

this.rawValue = iSum;

user305374

13-11-2018

I'm going to attempt to rebuild the form as you've described. My company's firewalls will not allow me to post anything to an accessible webspace. Probably the only way I could share it with you would be to share it from OneDrive via an email link but this would require that you share your email address with me.

I'm way over my head with trying to make this portion of the form work correctly. I was hoping I could get by using just the action builder feature in LiveCycle.

user305374

13-11-2018

The price field was built in Adobe Pro and is a simple numeric field, the On/Off checkboxes not radio buttons were built with Adobe pro also. I did this to get the best look. There is no table with Rows. The On/Off checkboxes also turn page views on and off within the document. Is there a way for me to share it with you?