作者redming (看我名片档!!)
看板Ajax
标题[问题] 动态生成上传栏位问题
时间Thu Dec 24 17:41:55 2009
各位好
我设计一个按钮按下去 动态产生上传栏位 但只会固定让它的name一样
没办法每一个的name都不同 ex file1, file2...etc
因为我想要用ASP上传 所以需要name
下面是目前写的 请指教一下 感恩>//<
<table id="product_tb" border="1" >
<tr><td><INPUT name="filea" type="file"></td></tr>
<tr><td><INPUT name="fileb" type="file"></td></tr>
</table>
<input type="button" name="addNew" value="新增上传" onClick="AddTR()">
= ============
function CreateRow()
{
var tb = document.all.product_tb;
// Insert one row at the reciprocal second of the table
var nRow = tb.insertRow(tb.rows.length) ;
var nod1="file" + (tb.rows.length-1)
nCell = nRow.insertCell() ;
nCell.innerHTML ="<input name='files' type='file' ><br>";
^^^^^ 这边有办法每次都不同嘛>"<
}
function AddTR()
{
var tb = document.getElementById("product_tb") ;
CreateRow() ;
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.157.18