This topic is locked

Js On Load + If Condition

2/24/2013 9:08:18 PM
PHPRunner General questions
N
nti author

Hoping for assist with JavaScript OnLoad event:
Hoping someone may point out the missing code to make a function work with specific conditions.


var ctrlSerChg = Runner.getControl(pageid, 'SerChg');

var ctrlPartsLabor = Runner.getControl(pageid, 'PartsLabor');

var ctrlTax_Calc = Runner.getControl(pageid, 'Tax_Calc');

var ctrlCounty = Runner.getControl(pageid, 'County');

var ctrlPartsCost = Runner.getControl(pageid, 'PartsCost');

function func() {
// issue begins with if statement. Does not work.
if (ctrlPartsCost =>0.01 && ctrlCounty == 'St Johns')
(ctrlTax_Calc.setValue((Number(ctrlSerChg.getValue()) + Number(ctrlPartsLabor.getValue())) * .06));

};
else
(ctrlTax_Calc.setValue((Number(ctrlSerChg.getValue()) + Number(ctrlPartsLabor.getValue())) * .07));
end
ctrlSerChg.on('keyup', func);

ctrlPartsLabor.on('keyup', func);


All feedback welcomed, thank you.

Sergey Kornilov admin 2/24/2013

Doesn't look like correct syntax to me. Start with syntax validation in PHPRunner Event editor.