- Tue Jun 28, 2016 10:31 am
#785951
Hi,
I have a form with 3 grids. Each grid has a subtotal. I am trying to calculate a Grand Total (subtotal1 +subtotal2+subtotal3).
I have the following javascript code written:
getField("SYS_GRID_AGGREGATE_adjuncts_adjunctsalary").onchange = calculate; //subtotal1
getField("SYS_GRID_AGGREGATE_fulltime_fulltimesalary").onchange = calculate; //subtotal2
getField("SYS_GRID_AGGREGATE_tempsvc_tempsvcsalary").onchange = calculate; //subtotal3
function calculate(){
var x = getField("SYS_GRID_AGGREGATE_adjuncts_adjunctsalary").value; //subtotal1
var y = getField("SYS_GRID_AGGREGATE_fulltime_fulltimesalary").value; //subtotal2
var z = getField("SYS_GRID_AGGREGATE_tempsvc_tempsvcsalary").value; //subtotal3
var r = x+y+z;
getField("totalpersonnel").value=r //grand total
}
I added the code by selecting the form properties and clicking on the javascript edit button.
Now when I preview the form I get the circling timer which never goes away and the form does not display??
Please Help....I am new to processmaker.
I have a form with 3 grids. Each grid has a subtotal. I am trying to calculate a Grand Total (subtotal1 +subtotal2+subtotal3).
I have the following javascript code written:
getField("SYS_GRID_AGGREGATE_adjuncts_adjunctsalary").onchange = calculate; //subtotal1
getField("SYS_GRID_AGGREGATE_fulltime_fulltimesalary").onchange = calculate; //subtotal2
getField("SYS_GRID_AGGREGATE_tempsvc_tempsvcsalary").onchange = calculate; //subtotal3
function calculate(){
var x = getField("SYS_GRID_AGGREGATE_adjuncts_adjunctsalary").value; //subtotal1
var y = getField("SYS_GRID_AGGREGATE_fulltime_fulltimesalary").value; //subtotal2
var z = getField("SYS_GRID_AGGREGATE_tempsvc_tempsvcsalary").value; //subtotal3
var r = x+y+z;
getField("totalpersonnel").value=r //grand total
}
I added the code by selecting the form properties and clicking on the javascript edit button.
Now when I preview the form I get the circling timer which never goes away and the form does not display??
Please Help....I am new to processmaker.