This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / xanada, I believe your code will work for me, but there must be sth. wrong in the inside FOR LOOP .Because an alert with "0" pops out when I put curser into the fileds.I can't figure out what problems are there. Could you check your code again? Your code as following: Thank you.
function countSum()
{
var nRow = 2;
var nCol = 3;
for (var i = 1; i <= nRow; i++)
{
var nSum = 0;
for (var j = 1; j <= nCol; j++)
{
var strTextName = "document.forms[0].col" + j + "_" + i;
var nNum = eval(strTextName + ".value");
nSum = nSum + nNum;
}
alert(nSum);
}
}
-waokool(waokool);
2002-7-2
{498}
(#611912@0)