怎样在Table中动态添加一行数据
bithw 2004-01-15 04:02:59 在Table中有5列,分别是Text,select,select,text,text类型,怎样动态增加包含上述类型的一行数据(select中的option也要复制过来)代码如下:
<table borderColor="#606060" cellSpacing="0" borderColorDark="#FFFFFF" cellPadding="0" width="600" align="center" borderColorLight="#606060" border="1" id=mytable>
<TR align="center" height="30" bgcolor="#8080FF">
<td><b>ÎïÁÏ´úÂë</b></td>
<td><b>Æ· Ãû</b></td>
<td><b>ÅúºÅ</b></td>
<td><b>¼ìÑéµ¥ºÅ</b></td>
<td><b>ÊýÁ¿ </b></td>
</tr>
<tr align=center id="NewTR">
<td><select name="MatID1" onChange="javascript:changelocation(document.hotelquery.MatID1.options[document.hotelquery.MatID1.selectedIndex].value);" size="1">
<option value=" | | |" selected>ÇëÑ¡Ôñ¡</option>
<option value="<%=trim(rs1("matid"))&"|" & trim(rs1("matname"))%>"><%=trim(rs1("matid"))%></option>
<%
rs1.movenext
do while not rs1.eof
%>
<option value="<%=trim(rs1("matid"))&"|" & trim(rs1("matname"))%>"><%=trim(rs1("matid"))%></option>
<%
rs1.movenext
loop
%>
</select></td>
<td><input type="text" name="MatName1" size="12" readonly></td>
<td><select name="BatchID1" size="1" onChange="javascript:checkid1(document.hotelquery.BatchID1.options[document.hotelquery.BatchID1.selectedIndex].value);">
<option value=" | | |" selected>ÇëÑ¡Ôñ¡</option>
</select>
</td>
<td><input type="text" name="PassID" readonly size="12"></td>
<td><input type="text" name="GoodsNum" size="20"></td>
</tr>
</table>