Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javascript function returning value

oratechsMay 23 2018 — edited May 23 2018

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.

pastedImage_7.png

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2018
Added on May 23 2018
6 comments
466 views