I have a table with four fields, Q1 Q2, Q3 and Total. All integers. Q1 control is a radio button, Q2 control is check box, Q3 is a direct entry control. Have the following code from the xLinesoft example:
// Place event code here.
// Use "Add Action" button to add code snippets.
var ctrlQ1 = Runner.getControl(pageid, 'Q1');
var ctrlQ2 = Runner.getControl(pageid, 'Q2');
var ctrlQ3 = Runner.getControl(pageid, 'Q3');
var crtlTotal = Runner.getControl(pageid, 'Total');
function func() {
ctrlTotal.setValue(parseFloat(ctrlQ1.getValue()) + parseFloat(ctrlQ2.getValue()) + parseFloat(ctrlQ3.getValue()));
};
ctrlQ1.on('click', func);
ctrlQ2.on('click', func);
ctrlQ3.on('keyup', func);
This is in both the Add page and Edit page: Javascript OnLoad event.
Total never updates. Am pulling my hair out why this doesn't work? Does the function need to be specifed some where in the HTML?