我搞定啦
给大家看看
多谢各位
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<%
a=split("aa,bb,cc,dd,ee",",")
b = split("44,55,66,77,88",",")
%>
<form id="form1" name="form1" method="post" action="">
<table width="100" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF"> </td>
<%for z = 0 to ubound(b)%>
<td bgcolor="#FFFFFF"><%=b(z)%></td>
<%next%>
<td bgcolor="#FFFFFF"> </td>
</tr>
<%
for i = 0 to ubound(a)
%>
<tr>
<td bgcolor="#FFFFFF"><%=a(i)%></td>
<%for z = 0 to ubound(b)%>
<td bgcolor="#FFFFFF"><input type="text" name="aa" id="aa" dd="<%=a(i)%>" onkeyup="calpay('<%=z%>','<%=i%>','<%=a(i)%>');" onkeydown="calpay('<%=z%>','<%=i%>','<%=a(i)%>');" /></td>
<%next%>
<td bgcolor="#FFFFFF"><input type="text" name="bb" id="bb" dd="<%=a(i)%>"/></td>
</tr>
<%next%>
</table>
</form>
<script language="javascript">
function calpay(a,b,ddx){
form = document.form1;
var obj = form.aa
var xx = 0
for(var i = 0;i<obj.length;i++){
if (obj[i].getAttribute("dd")==ddx){
xx += obj[i].value * 1
//alert(obj[i].value)
}
}
document.form1.bb[b].value = xx
}
</script>
</body>
</html>