function addinit(tbl)
{
var newRow = tbl.insertRow();
newRow.bgColor = "#E0E0E0";
newRow.className = "tableData";
newRow.onclick = new Function("lightonRow(this);");
var newCell = newRow.insertCell();
newCell.className = "scheduleButtonVisible";
newCell.innerHTML = "<input type=checkbox id=chkAppIt" + ItemNo + ">";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_name>";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_code>";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_meaning>";}
{
var newRow = tbl.insertRow();
newRow.bgColor = "#E0E0E0";
newRow.className = "tableData";
newRow.onclick = new Function("lightonRow(this);");
var newCell = newRow.insertCell();
newCell.className = "scheduleButtonVisible";
newCell.innerHTML = "<input type=checkbox id=chkAppIt" + ItemNo + ">";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_name>";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_code>";
var newCell = newRow.insertCell();
newCell.innerHTML = "<input class=inputTableData name=repeat_col" + ItemNo + "_meaning>";}
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<LINK href="debugger.css" type=text/css rel=STYLESHEET>
<script language="JavaScript" src="Debugger.js"></script>
<script language="JavaScript">Debugger=1;UseTimeStamp=1;DbgY=10;DbgWidth=300;</script><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="onlineEditTable.css" type=text/css rel=stylesheet>
<script language="javascript" src="onlineEditTable.js"></script>
</head>
<body>
<script language="JavaScript">
var StraddItem="";
var ItemNo=1; //,1,2,3,4...... function addinit(objTable)
{
var mybag="Mybag"+(ItemNo-1);
var tbodyOnlineEdit=objTable.getElementsByTagName("TBODY")[0];
var elm = document.createElement("TR");
var elmtd1 = document.createElement("td");
var elmtd2 = document.createElement("td");
var elmtd3 = document.createElement("td");
var elmtd4 = document.createElement("td");
var elminp1 = document.createElement("input");
var elminp2 = document.createElement("input");
var elminp3 = document.createElement("input");
var elminp4 = document.createElement("input");
elm.bgColor="#e0e0e0";
elm.className="tableData";
elm.onlick="lightonRow(this)";
elmtd1.className = "scheduleButtonVisible";
elminp1.type="checkbox";
elminp1.id ="tdt"; elminp2.className="inputTableData";
elminp2.name="repeat_col_name";
elminp3.className="inputTableData";
elminp3.name="repeat_col_code"; elminp4.className="inputTableData";
elminp4.name="repeat_col_meaning"; elmtd1.appendChild(elminp1);
elmtd2.appendChild(elminp2);
elmtd3.appendChild(elminp3);
elmtd4.appendChild(elminp4); elm.appendChild(elmtd1);
elm.appendChild(elmtd2);
elm.appendChild(elmtd3);
elm.appendChild(elmtd4); tbodyOnlineEdit.insertBefore(elm);
ItemNo=ItemNo+1;
}
function savecheck(objTable)
{
for (i=1;i<objTable.rows.length;i++)
{
var a = document.getElementsByName("repeat_col_name");
alert(a[0].value);//???????(得不到每行的 repeat_col_name,我想判断它们的值是否合法)
}
}
</script><form name=frmTableOnlineEdit method="post" action="../system/getMIform.jsp">
<input type="hidden" name="const_col_ksdm" value="<%=request.getParameter("ksdm")%>">
<input type="hidden" name="inputform" value="systab_dictionary">
<input type="hidden" name="colname" value="name_code_meaning">
<input type="hidden" name="const_col_kind" value="<%=request.getParameter("name")%>">
<input type="hidden" name="const_col_length" value="<%=request.getParameter("length")%>">
<TABLE bgColor=silver border=2 borderColorDark=gray borderColorLight=silver
cellPadding=2 cellSpacing=1 cols=1 id=tableOnlineEdit rules=rows width="100%" onKeyDown="navigateKeys()" onKeyUp="setKeyDown(false)">
<thead>
<tr bgColor=#0a6846>
<th class=thData width=1%>
<input type="hidden" name="bbb" value="ddddddddddddddd">
<input type=checkbox id=checkLineAll onclick=setOnlineEditCheckBox(getUpperObj(this,"TABLE"),this.checked)></th>
<th class=thData width=30%>名称</th>
<th class=thData width=30%>代码长度</th>
<th class=thData width=39%>含义</th>
</tr>
</thead>
<tbody>
</tbody></TABLE></form><p align=center>
<input type=button onclick="addinit(tableOnlineEdit)" value="新增">
<input type=button onclick="deleteRow(tableOnlineEdit)" value="删除">
<input type=button onclick="clearRow(tableOnlineEdit)" value="删除全部">
<input type=button onclick="savecheck(tableOnlineEdit)" value="保存">
</p>
</body>
</html>