Hi
I have the following code and it works fine if i want the total to be in a form field but i want to write the amount to the webpage using document.write, have tried all sorts but cant get it to work
can anyone help???
I have the following code and it works fine if i want the total to be in a form field but i want to write the amount to the webpage using document.write, have tried all sorts but cant get it to work
Code:
<script type="text/javascript">
function calculate(f)
{
var nums = f.num;
var ntext = f.num;
var result = 0;
for(var i=0;i<nums.length;i++)
{
if(nums[i].checked)
{
result+=parseFloat(ntext[i].value);
}
}
f.answer.value=Number(result).toFixed(2);
}
</script>
Comment