This discussion is archived
3 Replies Latest reply: May 28, 2013 2:45 AM by Sreenithi RSS

How to Calculate Total column dynamically in tabular form

Tulasi1243 Newbie
Currently Being Moderated
Hello,


I am trying to calculating the total column based on two columns, Total=unitprice*no.of items


I wrote this Javascript in page properties>javascrpt>Execute when Page Loads


"$('input[name=f05],input[name=f06]').change( function(){
parent_row = $(this).parents('tr:first');
sal = ( parent_row.find('input[name=f05]').val() == ' ') ? 0 : parseFloat(parent_row.find('input[name=f05]').val() );
comm = ( parent_row.find('input[name=f06]').val() == ' ') ? 0 : parseFloat(parent_row.find('input[name=f06]').val() );
total = sal * comm;
parent_row.find('input[name=f07]').val(total);
});

But its not Giving any result in total column?
Please any one could tel me where i did wrong?

Thanks,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points