I'm having difficulty adapting a code for my project, I need to add days to a date with javascript but the result is expected, could someone help me
follow the code below
var ctrlinicio = Runner.getControl(pageid, 'inicio');
var ctrln_dias = Runner.getControl(pageid, 'n_dias');
var ctrltermino = Runner.getControl(pageid, 'termino');
function func() {
ctrltermino.setValue(Number(ctrlinicio.getValue()) + Number(ctrln_dias.getValue()));
};
ctrlinicio.on('keyup', func);
ctrln_dias.on('keyup', func);
follow the code below
var ctrlinicio = Runner.getControl(pageid, 'inicio');
var ctrln_dias = Runner.getControl(pageid, 'n_dias');
var ctrltermino = Runner.getControl(pageid, 'termino');
function func() {
ctrltermino.setValue(Number(ctrlinicio.getValue()) + Number(ctrln_dias.getValue()));
};
ctrlinicio.on('keyup', func);
ctrln_dias.on('keyup', func);