有没有办法实现在按提交按钮后,弹出一个提示信息,在弹出提示信息的同时也提交◎◎◎◎

nineday 2007-01-09 09:40:31
有没有办法实现在按提交按钮后,弹出一个提示信息(页面或对话框...都可以),在弹出提示信息的同时也提交?
...全文
205 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eilien 2007-01-10
  • 打赏
  • 举报
回复
mark
cgisir 2007-01-10
  • 打赏
  • 举报
回复
同意xiao7cn(烧鸡)
把button的onclick写在一个函数里,第一行写myform.submit();然后写弹出
<script type="text/javascript">
function formsubmit(){
myform.submit();
alert("感谢您的提交!");
}
</script>

<form name="myform">
<input type="button" value="提交" onclick="formsubmit()">
</form>
xiao7cn 2007-01-09
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="http://www.google.com">
<p>
用户名:
<input type="text" name="textfield" />
</p>
<p>
密码:
<input type="text" name="textfield2" />
</p>
<p>
<label>
<input type="button" name="Submit" value="提交吧" onclick="document.all.form1.submit();alert('感谢您提交的申请,我们稍后会进行处理。');"/>
</label>
</p>
</form>
</body>
</html>

-----------
看看这样行不行?
leohuang 2007-01-09
  • 打赏
  • 举报
回复
<style>
.msg{
border:1px solid #888;
background:#f7f7f7;
width:300px;
heght:50px;
line-height:50px;
position:absolute;
z-index:99;
text-align:center;
}
</style>
<script type="text/javascript">

function showMsg(msg){
var div = document.getElementById("divMsg");
if(div==null){
div = document.createElement("div");
div.className="msg";
document.body.appendChild(div);
}
div.innerHTML=msg;
div.style.left=document.body.clientWidth/2-150;
div.style.top=document.body.clientHeight/2-25;
}
</script>

<form onsubmit="showMsg('正在加载数据...');" action="http://mail.163.com">
<input type="submit" value="submit">
</form>

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧