title: Javascript and Ajax each row 3 different Total Calculations not working properly
body: <p>Here is the script used by ajax library and javascript.</p>
  
  <p>Total order column Total price working fine.
  But 
  Total Calculations for the discount column and net price column not working properly.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $('.row1').keyup(function(ev){
  
          var row1c = $(this).val() * 25;
          $('.row1c').html((row1c).toFixed(2));
  
      });
      $('.row1a').keyup(function(ev){
  
          var row1ac = $(this).val() * 15;
          $('.row1ac').html((row1ac).toFixed(2));
  
      });
      $('.row1b').keyup(function(ev){
  
          var row1bc = $(this).val() * 10;
          $('.row1bc').html((row1bc).toFixed(2));
  
      });
  
     $('.row2').keyup(function(ev){
  
          var row2c = $(this).val() * 45;
          $('.row2c').html((row2c).toFixed(2));
  
      });
      $('.row2a').keyup(function(ev){
  
          var row2ac = $(this).val() * 25;
          $('.row2ac').html((row2ac).toFixed(2));
  
      });
      $('.row2b').keyup(function(ev){
  
          var row2bc = $(this).val() * 20;
          $('.row2bc').html((row2bc).toFixed(2));
  
      });
    $('input[type=text]').keyup(function(){
      var total = 0;
      $('input[type=text]').each(function(){
        total += Number($(this).parent().next().find('span').text());
      })
      $('.row5c').text(total.toFixed(2));
    })
  
  
    $('input[type=text]').keyup(function(){
      var total = 0;
      $('input[type=text]').each(function(){
        total += Number($(this).parent().next().find('span').text());
      })
      $('.row55c').text(total.toFixed(2));
    })
     $('input[type=text]').keyup(function(){
      var total = 0;
      $('input[type=text]').each(function(){
        total += Number($(this).parent().next().find('span').text());
      })
      $('.row555c').text(total.toFixed(2));
    })
  });
  
  
  &lt;/script&gt;
  
  &lt;table border="2" cellpadding="5" cellspacing="2" align="center"&gt;
  
  
    &lt;tr&gt;
      &lt;th&gt;Cracker Name&lt;/th&gt;
      &lt;th&gt;Cracker Photo&lt;/th&gt;
      &lt;th&gt;Packing Model&lt;/th&gt;
      &lt;th&gt;Retail Price&lt;/th&gt;
      &lt;th&gt;You Save (Discount - 60%) &lt;br /&gt;&lt;/th&gt;
  
      &lt;th&gt;Selling Price&lt;br /&gt;&lt;/th&gt;
  
      &lt;th&gt;Quantity&lt;/th&gt;
      &lt;th&gt;Total Order&lt;/th&gt;
      &lt;th&gt;Discount&lt;/th&gt;
      &lt;th&gt;Net Price&lt;/th&gt;
    &lt;/tr&gt;
  
  
    &lt;tr&gt;
      &lt;td&gt;3.5'' Laxmi&lt;/td&gt;
      &lt;td&gt;--&lt;/td&gt;
      &lt;td&gt;5 in 1 Packet&lt;/td&gt;
      &lt;td&gt;25&lt;/td&gt;
      &lt;td&gt;15&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
      &lt;td&gt;
        &lt;input type="text" name="pages" class="row1 row1a row1b" /&gt;    &lt;/td&gt;
      &lt;td&gt;&lt;span class="row1c"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
        &lt;td&gt;&lt;span class="row1ac"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
          &lt;td&gt;&lt;span class="row1bc"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3.5'' Laxmi&lt;/td&gt;
      &lt;td&gt;--&lt;/td&gt;
      &lt;td&gt;5 in 1 Packet&lt;/td&gt;
      &lt;td&gt;45&lt;/td&gt;
      &lt;td&gt;25&lt;/td&gt;
      &lt;td&gt;20&lt;/td&gt;
      &lt;td&gt;
        &lt;input type="text" name="pages" class="row2 row2a row2b" /&gt;    &lt;/td&gt;
      &lt;td&gt;&lt;span class="row2c"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
        &lt;td&gt;&lt;span class="row2ac"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
          &lt;td&gt;&lt;span class="row2bc"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
    &lt;/tr&gt;
  
  
  
  
  
  
    &lt;tr&gt;
      &lt;td colspan="7" align="right"&gt;Total  &lt;/td&gt;
  
      &lt;td&gt;&lt;span class="row5c"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
       &lt;td&gt;&lt;span class="row55c"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
        &lt;td&gt;&lt;span class="row555c"&gt;0.00&lt;/span&gt;    &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>