I have this JavaScript code in the onChange event on a field. The result is that the field ‘sum’ should show the sum of the variables.
-
This work well but the number is an integer - how can I get it to be decimal numeral?
-
The ‘sum’-field is of type editable. I actual want the field to be computed so the user can’t write in the field… how can I do this? If I change the field to computet my code doesn’t work…
var f = document.forms[0]
cal1 = f.Ant1.value * 49
cal2 = f.Ant2.value * 2,85
cal3 = f.Ant3.value * 15,50
cal4 = f.Ant4.value * 2,95
f.Sum.value = cal1 + cal2 + cal3 + cal4