One challenge I am facing is within an MVC Edit form that contains two fields named ExVAT and VAT. I would like to introduce a new field that displays the total of these two values.
Currently, the total only reflects the sum of the two fields upon initial loading of the form. However, if either of the fields is edited, the total does not dynamically update to reflect the new combined value.
For instance, in the screenshot provided:
Although I have modified the Ex.Vat figure from 22 to 32, the total has not been recalculated (I will address formatting once the value is correct).
The current code used to calculate the total is as follows:
@Html.Raw(Model.Vat + Model.ExVat)
What approach would be most effective in ensuring that the total field automatically updates as adjustments are made to the other fields?