How to calculate a totals field in a form with 20 currency input fields?

I’m not sure what the 138 is for - I would have thought vat_yes_no.value should equal 1 or 0 perhaps, to indicate whether VAT is applicable or not. So the onclick event would set the this value and you would just use dmx-bind:value for the VAT calculations. Using an onclick event to calculate the VAT could be a problem in that it would need to be clicked again if any figures were changed. (I am not too clear on the various issus in this thread, so this might not be useful at all).