做一个多文件上传的系统,需要动态产生文件域,就像hotmail那样,点击一个按钮,出来一个文件域,如何实现?
解决方案 »
- struts 2在weblogic下运行奇怪问题?网上搜索无结果
- 有没有知道.YQS是什么文件的后缀的?
- 为什么 对象不支持此属性或方法?请指导
- 客户端的java虚拟机会不会影响网站访问速度
- 设计一段SQL程序,让用户输入其中的任意的N个条件(N>=0,N<=4),根据用户的输入找出与之相匹配的记录
- asp.net 特殊字符替换 100分求解
- 救命呀~!!卖血救命呀~!!调用jacob的问题
- 紧急求助:为什么我新开页面中getparameter得到的均为乱码,无论如何转换,都没用。
- reset button
- 菜鸟问题:为什么我的hello.class 竞然不能用 java.exe运行?
- java程序员如何开发web2.0
- 窗口问题
<input type="button" onclick="test.innerHTML += '<input name=n>';">
function addAttachment() {
var index = sequence++;
var area = document.getElementById("attach_area");
area.innerHTML +=
"<div id=\"attach_" + index + "\">" +
"<input name=\"attach_file_"+index+"\" type=\"file\" />" +
"<input type=\"button\" value=\"删除\" onclick=\"removeAttachment("+index+")\">" +
"</div>";
}function removeAttachment(index) {
var attachment = document.getElementById("attach_"+index);
if (attachment == null) {
return;
}
attachment.innerHTML = "";
attachment.outerHTML = "";
}
这是JS代码
</div>
<input type="button" value="添加附件" onclick="addAttachment()"/>
这是html片断,为什么,无论我添加几个附件index的一直是1????