<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language="JavaScript1.2">
var theTable,theTableBody;
function addNew(form){
var theTable=(document.all)?document.all.t1:document.getElementById("t1");
var theTableBody=theTable.tBodies[0];//tBodies是TBODY对象数组
var newCell;
var newRow=theTableBody.insertRow(-1);
newCell=newRow.insertCell(0);
var str='上传文件:<input type="file" name="upfile[]"><input type="checkbox" onClick="addNew(this.form)">'
newCell.innerHTML=str;
}
</script>
</HEAD>
<BODY>
<form id="f" name="up" enctype="multipart/form-data" method="post" action="fileupload.php">
<table name="t1" id="t1" width="100%" border="0">
<TBODY name="tb1" id="tb1">
<tr>
<td>
<input type="submit" name="Submit" value="上传"><br>上传文件:<input type="file" name="upfile[]"><input type="checkbox" onClick="addNew(this.form)"></td>
</tr>
</tbody>
</table>
</form>
</BODY>
</HTML>
来自:http://www.phpx.com/happy/viewthread.php?tid=49372