请问用jsp如何实现发送邮件时“增加附件”和“删除附件”这样的功能??? 如何实现一下功能:点击“增加附件”按钮,增加一个file控件和一个“删除附件”按钮。点击“删除附件”按钮,删除刚才增加的file控件和“删除附件”按钮。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head></head><body><div id='div1' style='visibility: hidden'> <input type='file' name='txtfn'/></div><input type='button' value='show' onclick='f();'/><script language=jscript> function f() { document.all.div1.style.visibility = 'visible'; }</script></body></html>将 visibility 再设置为 'hidden' 就又看不见了。 上面的例子 只能增加一个file控件!而且file控件div为'hidden' 时,它还占据着一个控件的位置我希望能增加多个控件,而且点击“删除”按钮时,file控件消失的同时,下面的元素能上移,而不至于留下一块空白的区域可参见163邮箱增加附件的效果还有没有好办法??非常感谢! 可以再附件处加一个iframe,点击增加附件时候刷新iframe,把iframe调用的jsp页面改了 visibility 再设置为 'hidden' function spread(){ document.getElementById("ok").style.display= (document.getElementById("ok").style.display =='none')?'':'none';}<table id="ok" style="display:none"><tr align="center" bgcolor="#FFFFFF" ><td colspan="7"> <input type='file' name='txtfn'/></td></tr></table><input type='button' value='show' onclick='spread();'/> <html><head><title>Test</title><script type="text/javascript"><!--var sequence = 0;function addAttachment() { var index = sequence++; var area = document.getElementById("attach_area"); area.innerHTML += "<div id=\"attach_" + index + "\">" + "<input id=\"attach_file\" 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 = "";}function removeAll() { if (sequence != 0 && !confirm("您确定吗?")) { return; } for (var i = sequence; i-- > 0; removeAttachment(i)); sequence = 0;}//--></script></head><body><form action=""><div id="attach_area"></div><input type="button" value="追加" onclick="addAttachment()"/><input type="button" value="全删除" onclick="removeAll()"/></form></body></html> Jsp+poi+servlet导入excel到数据库表 java.lang.ClassCastException: [Ljava.lang.Object; spring使用aspectj时候 加载配置配置文件出错 怎么让数据导出到excel中 请问一下一般论坛的热门话题是根据什么条件来选出来的呢? 做了个web应用打印控件,用了4Fang WEB 打印控件,免费 为什么不即时更新? 如何重建session? 问一个关于TOMCAT服务器的问题 用jdbc-odbc驱动桥怎么做数据的分页呀?谢谢! 请教大家一个关于用servlet写cookie的问题~! jsp如何连接access
<head>
</head>
<body>
<div id='div1' style='visibility: hidden'>
<input type='file' name='txtfn'/>
</div><input type='button' value='show' onclick='f();'/><script language=jscript>
function f() {
document.all.div1.style.visibility = 'visible';
}
</script>
</body>
</html>将 visibility 再设置为 'hidden' 就又看不见了。
而且file控件div为'hidden' 时,它还占据着一个控件的位置我希望能增加多个控件,而且点击“删除”按钮时,file控件消失的同时,下面的元素能上移,而不至于留下一块空白的区域可参见163邮箱增加附件的效果还有没有好办法??非常感谢!
{
document.getElementById("ok").style.display= (document.getElementById("ok").style.display =='none')?'':'none';
}
<table id="ok" style="display:none">
<tr align="center" bgcolor="#FFFFFF" >
<td colspan="7">
<input type='file' name='txtfn'/>
</td>
</tr>
</table>
<input type='button' value='show' onclick='spread();'/>
<head>
<title>Test</title>
<script type="text/javascript">
<!--
var sequence = 0;
function addAttachment() {
var index = sequence++;
var area = document.getElementById("attach_area");
area.innerHTML +=
"<div id=\"attach_" + index + "\">" +
"<input id=\"attach_file\" 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 = "";
}function removeAll() {
if (sequence != 0 && !confirm("您确定吗?")) {
return;
}
for (var i = sequence; i-- > 0; removeAttachment(i));
sequence = 0;
}
//-->
</script>
</head>
<body>
<form action="">
<div id="attach_area">
</div>
<input type="button" value="追加" onclick="addAttachment()"/>
<input type="button" value="全删除" onclick="removeAll()"/>
</form>
</body>
</html>