The below code currently works with HTML textboxes and checkboxes, how do I use this Client-Side script with asp:Textboxes and asp:Checkboxes?
<html>
<head>
<script type="text/javascript">
function calculate(f)
{
var nums = f.num;
var ntext = f.numtext;
var nitem = f.numitem;
var result = 0;
var items = '';
for(var i=0;i<nums.length;i++)
{
if(nums[i].checked)
{
result+=parseFloat(ntext[i].value);
items+=nitem[i].value+'\n';
}
}
//f.answer.value=result;
//if you want to fix to 2 decimal places
f.answer.value=Number(result).toFixed(2);
f.allitems.value=items;
}
Go to the complete details ...