How can you action a calculation on query load?

I am using SPA pages.

I have a series of on-click event calculations, so in the example below on item “31 Tyre -run flat” when “3” is clicked the calculation ‘3 x 150’ is made and the result ‘450’ is set into the Cost field.

This is great when first accessing the page and the user goes through and clicks the various options, BUT my issue comes after the data is saved and then recalled. I can populate the options (as shown for items 29 and 30, but how do I trigger the calculation?

The total of the cost is not stored at this stage because there are other variables that come into play.

The code used in the on-click event…
specialist_total.setValue((specialist_radio.value * specialist_cost).formatNumber(2, ".", ""))

Community Page
Last updated: