3 Replies Latest reply: May 28, 2013 4:45 AM by Sreenithi RSS

    How to Calculate Total column dynamically in tabular form

    Tulasi 1243
      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,