Auto add calculation by column pop up link

Auto add calculation by column pop up link

Hi, 

1. I have a problem regarding jquery auto add calculation. It is a timesheet hour calculation. Basically, I've done 90% of it and other 10% I cant seem to be found the solution.

This the script:
  1. <script type="text/javascript">
  2.               $(document).ready(function () {

  3.             $('[data-toggle="popover"]').popover();
  4.             $('[id*=remarks_link]').popover();

  5.             function DisableDays(date) {
  6.                 var day = date.getDay();
  7.                 // If day == 5 then it is FRiday only enable understand bijes
  8.                 if (day == 5) {
  9.                     return [true];
  10.                 } else {
  11.                     return [false];
  12.                 }
  13.             }
  14.             $(function () {
  15.                 $('[id*=tb_date_pick]').datepicker({

  16.                     changeMonth: true,
  17.                     dateFormat: 'dd/mm/yy',
  18.                     todayHighlight: true,
  19.                     showAnime: 'fadeIn',
  20.                     duration: 'fast',
  21.                     beforeShowDay: DisableDays
  22.                 });
  23.             });

  24.             $(function () {
  25.                 $('#<%= GridView1.ClientID %> .tb_day').val("0");
  26.             });
  27.             $('#<%= GridView1.ClientID %> .tb_day').blur("change", function () {
  28.                 if (isNaN(parseInt($(this).val()))) {
  29.                     $(this).val('0');
  30.                 } else {
  31.                     $(this).val(parseInt($(this).val()).toString());
  32.                 }
  33.             });
  34.             $('#<%= GridView1.ClientID %> .tb_day').blur("keyup", function () {
  35.                 if (!jQuery.trim($(this).val()) == '') {
  36.                     if (!isNaN(parseFloat($(this).val()))) {
  37.                         var row = $(this).closest("tr");
  38.                         $("[id*=hTest]", row).val(parseFloat($("[id*=tb_nt_sat]", row).val()) + parseFloat($("[id*=tb_nt_mon]", row).val()) + parseFloat($("[id*=tb_nt_tue]", row).val()) + parseFloat($("[id*=tb_nt_wed]", row).val()) + parseFloat($("[id*=tb_nt_thu]", row).val()) + parseFloat($("[id*=tb_nt_fri]", row).val()));
  39.                     }
  40.                 } else {
  41.                     $(this).val('');
  42.                 }

  43.             var grandTotal = 0;
  44.                 $("[id*=hTest]").each(function () {
  45.                     grandTotal = grandTotal + parseFloat($(this).val());
  46.                 });
  47.                 $("[id*=total_nt]").val(grandTotal.toString());

  48.                 var satTot = 0;
  49.                 var col = $(this).closest("td");
  50.                 $("[id*=tb_nt_sat]").each(function () {

  51.                     satTot += parseFloat($("[id*=tb_nt_sat]", col).val());
  52.                     //                    satTot += parseFloat($(this).val());
  53.                 });
  54.                 $("[id*=tb_nt_sat_tot]").val(satTot.toString());

  55.             });

  56.         }); 
  57.     </script>

The 'satTot' seems not working as i expect( Auto add dynamically by column in  gridview)


2. For popup link,I was thinking about using a link to a hidden textbox (for remark) and onmouse click, system will be displayed the textbox which consist of a few information from database and text area for remarking. I, thinking of simplest code for this. Can anyone advise me on  this?