Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
<script type="text/javascript">


jQuery('.CsDebt').live('change', function(event) {
event.preventDefault();
//alert(10);
//$(".CsTotalDebit").text("0.00");
var Total = $(this).closest("tr").find('.CsDebt').val();
//alert(Total);
var m = 0;
$(".authors-list tr").each(function(index) {
if (index != 0) {
var Totals = $(this).find('.CsDebt').val();
//alert(Totals);
//Totals = parseFloat(Totals);
//alert(Totals);
m = Number(m) + Number(Totals);
alert(m);
$(".CsTotalDebit").text(m);
//$(".CsTotalDebit").text('hello');
//$("#lbl_Debit").text(m);

}

});

});

i want to bind the m value to a label whose class name is CsTotalDebit

when i am trying to execute the bold lined command it shows NaN

upto the alert message value is comming correctly..

after that it shows the problem..

pls help me
thanks in advance.
Posted
Comments
Mohammed Hameed 13-May-13 2:30am    
Its not a problem with m value, its a problem with CsTotalDebit. Check the correct spelling of it and also syntax.

1 solution

I think code should be like below, try it:

$('#CsTotalDebit label').text(m);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900