Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to Recalulate Fields?

Avatar

Former Community Member

1 Reply

Avatar

Former Community Member
How would you script the following:



An order form, with a calculated field - "TotalCost", to which you want to apply a surcharge percentage if a checkbox is checked. I can create it with a user entered field, but haven't been able to get it to work with a calculated field.



This is the script I have come up with to add 15% to a total (in the click event for the checkbox):



if (this.rawValue == "1")

TotalCost.rawValue *= 1.15;

else

TotalCost.rawValue /= 1.15;



Works fine for user-entered values, not at all for calculated data.