请问用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> 纯java如何获得硬件唯一标识 http服务器的网页存放地址问题 关于实体的问题,请高手帮助?????十分着急!!!!!!!!!!! tomcat连接sql2000数据库问题 50分求助jsp视频教程,分不够可以再加!只要能播放马上送分! 一老大,这样定义程序接口,感觉怪怪的,可是我又说不出充分的理由来否定这样的设计 请问如何设置Cookie中的value是中文字符 如何刷新的时候,页面不返回页面的顶端 Calendar.DAY_OF_WEEK是什么意思? 你对自己有自信吗?请进>>> 请教大家一个关于用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>