孙涛个人资料身高多少:有一行表格,点击按钮后,如何再添加一行呀

来源:百度文库 编辑:高校问答 时间:2024/04/29 15:30:42
问题一:
有一行表格,点击按钮后,再添加一行呀,以此类推,没有上限。(表格中含有文本域,在提交表单时,要取得此文本域的值)
问题二:
表单添加成功后,如何将此表单(有可能会有多条记录)批量添加到数据库?
环境:ASP+ACCESS

<script>

var gzcontent="";
function addTable()
{
var tableID=document.all.loop;
var oRow=tableID.insertRow(tableID.rows.length);
var oCell=oRow.insertCell(oRow.cells.length);
oCell.innerHTML=gzcontent;

}
function initContent()
{
gzcontent=document.all.tb1.outerHTML;
}
</script>
<body onload="initContent()">

<table border = 1 id="loop">
<tr>
<td>
<table id="tb1">
<tr>
<td>username:</td><td><input type="text" value="dinghb"></td>
</tr>
<tr>
<td>password</td><td><input type="password" value="dinghb"></td>
</tr>
<tr>
<td colspan="2" id="tdid0">
<input type="button" value="add table" onclick="addTable()">
</td>
</tr>
</table>
</td>
</tr>

</table>
</body>

什么环境下?你在做网站吗?