Hello all,
I got the example from the manual to calculate values on the fly, but I have more tan 3 fields and the problem is that sometimes not all the fields are filled so in the result (total) I get NaN if not all the fields have a value. Is there a way to fix this? there are more than 5 fields. here is the code i have maybe there is a solution for this
var cs1 = Runner.getControl(pageid, 'funeral_director_and_stuff');
var cs2 = Runner.getControl(pageid, 'embalming');
var cs3 = Runner.getControl(pageid, 'reconstruction');
var cs4 = Runner.getControl(pageid, 'dressing');
var cstotal = Runner.getControl(pageid, 'total_services');
function func() {
cstotal.setValue(parseFloat(cs1.getValue()) + parseFloat(cs2.getValue()) + parseFloat(cs3.getValue()) + parseFloat(cs4.getValue()));
};
cs1.on('keyup', func);
cs2.on('keyup', func);
cs3.on('keyup', func);
cs4.on('keyup', func);
Thanks for your help