求:客户端vbscript动态表格程序……在线等
客户端初始表格:
<table border="0" cellpadding="0" cellspacing="0" width="45%">
<tr>
<td width="52%" valign="middle" align="center">名称</td>
<td width="48%" valign="middle" align="center">数量</td>
</tr>
<tr>
<td width="52%" valign="middle" align="center">提问问题</td>
<td width="48%" valign="middle" align="center">1</td>
</tr>
</table>
调用客户端vbscript N次,提交N次参数结果如下:
<table border="0" cellpadding="0" cellspacing="0" width="45%">
<tr>
<td width="52%" valign="middle" align="center">名称</td>
<td width="48%" valign="middle" align="center">数量</td>
</tr>
<tr>
<td width="52%" valign="middle" align="center">提交数据1</td>
<td width="48%" valign="middle" align="center">1</td>
</tr>
......
<tr>
<td width="52%" valign="middle" align="center">提交数据n</td>
<td width="48%" valign="middle" align="center">1</td>
</tr>
</table>
请高手指教,如何实现?
------解决方案--------------------
HTML code
<input type="button" value="添加" onclick="add()"/><table border="0" cellpadding="0" cellspacing="0" width="45%">
<tr>
<td width="52%" valign="middle" align="center">名称</td>
<td width="48%" valign="middle" align="center">数量</td>
</tr>
<tbody id="tb"></tbody>
</table>
<script language="vbscript">
function add()
dim tr,td
set tr=tb.insertRow(tb.rows.length):set td=tr.insertcell(0)
td.innerhtml="<input type='button' value='删除' onclick='remove(this)' /><input type='text' />"
set td=tr.insertcell(1):td.innerhtml="<input type='text' />"
end function
function remove(btn)
tb.removeChild btn.parentnode.parentnode
end function
</script>