<!DOCTYPE HTML PUBLIC "
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">// Example: obj = findObj("image
function findObj(theObj
{
var p
if(!theDoc) theDoc = document;
if( (p = theObj
{ theDoc = parent
}
//添加一個參與人填寫行
function AddSignRow(){ //讀取最後一行的行號
var txtTRLastIndex = findObj("txtTRLastIndex"
var rowID = parseInt(txtTRLastIndex
var signFrame = findObj("SignFrame"
//添加行
var newTR = signFrame
newTR
//添加列:序號
var newNameTD=newTR
//添加列內容
newNameTD
//添加列:姓名
var newNameTD=newTR
//添加列內容
newNameTD
//添加列:電子郵箱
var newEmailTD=newTR
//添加列內容
newEmailTD
//添加列:電話
var newTelTD=newTR
//添加列內容
newTelTD
//添加列:手機
var newMobileTD=newTR
//添加列內容
newMobileTD
//添加列:公司名
var newCompanyTD=newTR
//添加列內容
newCompanyTD
//添加列:刪除按鈕
var newDeleteTD=newTR
//添加列內容
newDeleteTD
//將行號推進下一行
txtTRLastIndex
}
//刪除指定行
function DeleteSignRow(rowid){
var signFrame = findObj("SignFrame"
var signItem = findObj(rowid
//獲取將要刪除的行的Index
var rowIndex = signItem
//刪除指定Index的行
signFrame
//重新排列序號
for(i=rowIndex;i<signFrame
signFrame
}
}//清空列表
function ClearAllSign(){
if(confirm(
var signFrame = findObj("SignFrame"
var rowscount = signFrame
//循環刪除行
for(i=rowscount
signFrame
}
//重置最後行號為
var txtTRLastIndex = findObj("txtTRLastIndex"
txtTRLastIndex
//預添加一行
AddSignRow();
}
}
</script>
</HEAD>
<BODY>
<div>
<table width="
<tr id="trHeader">
<td width="
<td width="
<td width="
<td width="
<td width="
<td width="
<td width="
</tr>
</table>
</div>
<div>
<input type="button" name="Submit" value="添加參與人" />
<input type="button" name="Submit
<input name=
</div>
</BODY>
</HTML>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20367.html