Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

user305374
Level 1
Level 1

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

1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

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.

View solution in original post

5 Replies
radzmar
Level 10
Level 10

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
Level 1
Level 1

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?

radzmar
Correct answer by
Level 10
Level 10

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.

View solution in original post

user305374
Level 1
Level 1

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
Level 1
Level 1

I just wanted to Thank you again for your support. You helped me tremendously, and I really appreciate it.