Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hi
I am using dynamic textbox for my Item table.
In that one textbox name is TotalAmount.
I need to calculate the sum of Total amount.

Could you please advice how to do?

Thanks
Posted
Comments
coded007 8-Dec-11 5:15am    
Can you please give me sample code
Sravan S 8-Dec-11 7:12am    
Provide the sample code or elaborate d question a bit if possible.

1 solution

function Read_Data()
{
var str=0;
var Grid_Table = document.getElementById('<%=grid_list.ClientID%>');
for(var row=1; row<Grid_Table.rows.length; row++)
{
if(document.all)
str=str+Number(Grid_Table.rows[row].cells[3].innerText);

else
str=str+Number(Grid_Table.rows[row].cells[3].textContent);

}
alert(str);
return false;
}
// javascript code
//If you using gridview use above code otherwise try like this
 
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