<script>
function addFile()
{
var str = '<table><tr nowrap><td nowrap>属性:</td><td><INPUT type="text" size="20" NAME="File"></td></tr><tr><td>值:</td><td align="right"><INPUT type="text" size="20" NAME="Filex"></td></tr></table><br>'
document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str)
}
</script>
<script language="JavaScript">
<!--
function creatt(n) {
var strText = ""
for (i=0; i<n; i++)
{
strText = strText + '<table><tr nowrap><td nowrap>属性:</td><td><INPUT type="text" size="20" NAME="File"></td></tr><tr><td>值:</td><td align="right"><INPUT type="text" size="20" NAME="Filex"></td></tr></table>'
}
document.getElementById("MyFile").innerHTML=strText;
}
//-->
function test()
{
var oP =document.all["MyFile"];
document.all["hid_Values"].value = "";
var i;
for(i=0;i<oP.children.length;i++)
{
document.all["hid_Values"].value += oP.children(i).value;
if (i<oP.children.length-1)
{
document.all["hid_Values"].value +=",";
}
}
alert(document.all["hid_Values"].value);
}
</script>
<form id="form1" method="post" runat="server" action="">
<div align="center" style="Z-INDEX:101;LEFT:176px;WIDTH:176px;POSITION:absolute;TOP:48px; HEIGHT:126px">
<h3>多文件上传</h3>
<P id="MyFile"></P>
<P>
<input name="num" type="text" size="3">
<input type="button" value="文本框数目" οnclick="creatt(num.value)"><br />
<input type="button" value="增加(Add)" οnclick="addFile()" style="WIDTH:68px; HEIGHT:22px">
<input type="hidden" id="hid_Values">
<!--<asp:Button Runat="server" Text="开始上传" ID="UploadButton" Width="69px"></asp:Button>-->
<input type="button" value="开始上传" οnclick="test()">
</P>
</div>
</form>