I've created a dynamic action : on change jQuery selector.
input[name="f20"],input[name="f21"]
under true action calling below function
var vtotal = javascript:totals(this.triggeringElement.id);
on page header under javascript. i have the following function.
function totals(pid)
{
var totHours = 0;
var totCost;
var vrowid ;
vrowid = $("#"+pid+"").attr('id').substr(4);
if($("#f20_"+vrowid+"").length >0 )
{
totHours += Number($("#f20_"+vrowid+"").val());
//console.log(totHours);
}
if($("#f21_"+vrowid+"").length >0 )
{
totHours += Number($("#f21_"+vrowid+"").val());
}
totHours = Math.round(totHours*168);
//totCost = totHours * Number($("#f17_"+vrowid+"").val().substr(1));
// totCost = '$'+totCost.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
//totCost = '$'+totCost.toLocaleString(undefined, {maximumFractionDigits:2});
console.log(totCost);
return totHours;
}
but i'm getting below error , I don't know how to fix it. i am new to javascript.
