Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Help please

Avatar

Level 1

Hi I am new user adobeLiveDesigner I try to do order form  and i need a help. Total column is a multiply of price and qty but for some products have to be multiply of price qty and size. Hope thats sound clear.Can anyone help me please.

Capture.JPG

1 Accepted Solution

Avatar

Correct answer by
Level 7

It sounds like you're going to have to use some clever logic to add that possibility. I would say something like this in the calculate event of the total box:

if (tfProductCode.rawValue == "widgits" || tfProductCode.rawValue == "gizmos || ... )

     this.rawValue = this.parent.tfSize.rawValue * this.parent.tfQuantity.rawValue * this.parent.tfPrice.rawValue;

else this.rawValue = this.parent.tfQuantity.rawValue * this.parent.tfPrice.rawValue;

Or if your list of items that qualify is much longer, you can have a for loop fun through the list first and look for a matching value, then if it finds one, do the calculation.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

It sounds like you're going to have to use some clever logic to add that possibility. I would say something like this in the calculate event of the total box:

if (tfProductCode.rawValue == "widgits" || tfProductCode.rawValue == "gizmos || ... )

     this.rawValue = this.parent.tfSize.rawValue * this.parent.tfQuantity.rawValue * this.parent.tfPrice.rawValue;

else this.rawValue = this.parent.tfQuantity.rawValue * this.parent.tfPrice.rawValue;

Or if your list of items that qualify is much longer, you can have a for loop fun through the list first and look for a matching value, then if it finds one, do the calculation.

Avatar

Level 10

Euhmm... looks like you don't want to use JavaScript to do this... JavaScript is to interact with the form and the values...

and for maths you should be using FormCalc... you only need to write one line of code!!

Look out the FormCalc User Reference for help... everything is in there

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf