如何实现表单提交时提示正在发送
来源:风之相随BLOG 时间:2008-12-23 13:30:00
很简单的方法,但很实用。用过新浪邮箱的朋友应该会知道此脚本的效果。如果您提交的数据处理时间很长,用这个做为提示很不错的.
将下面的代码复制到<head>~</head>里
程序代码
<script language=javascript>
<!--
function showSending() {
sending.style.visibility="visible";
}
-->
</script>
将下面的代码复制到<body>~</body>里
程序代码
<form method="post" action="../0001/success.asp"><div id="sending" style="position:absolute; z-index:10; width: 400; visibility: hidden">
<table width=400 height=80 border=0 cellspacing=2 cellpadding=0 bgcolor="#8FA8E9">
<tr>
<td bgcolor=#eeeeee align=center>内容正在发送, 请稍候...</td>
</tr>
</table>
</div>
<table width="95%" border="1" cellspacing="0" cellpadding="1" bordercolorlight="#8FA8E9" bordercolordark="#FFFFFF">
<tr align="center">
<td height="30" class="bg3" colspan="2">
<input type='submit' name='ACTION' value='发送' onClick="showSending()">
</td>
</tr>
</table>
</form>
分解说明:
第一步:
先制作一个图层,里面放好你要显示的文件,然后隐藏,如下:
程序代码
<div id="sending" style="position:absolute; z-index:10; width: 400; visibility: hidden">
<table width=400 height=80 border=0 cellspacing=2 cellpadding=0 bgcolor="#8FA8E9">
<tr>
<td bgcolor=#eeeeee align=center>内容正在发送, 请稍候...</td>
</tr>
</table>
</div>
第二步:
定义表单的提交按钮的Onclike事件:
程序代码
<input type='submit' name='ACTION' value='发送' onClick="showSending()">
第三步:
将提交按钮的事件定义成Javascript:
程序代码
<script language=javascript>
<!--
function showSending()
{
sending.style.visibility="visible"; // 修改sending图层的属性为可显示的图层
}
-->
</script>
标签:提示,表单,脚本,新浪
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
随机提取N条记录方法
2007-10-11 18:04:00
python实现输出一个序列的所有子序列示例
2022-04-13 18:34:45
![](https://img.aspxhome.com/file/2023/5/121845_0s.jpg)
复制SqlServer数据库的方法
2024-01-26 22:46:26
CSS属性behavior的语法及介绍
2010-01-13 12:40:00
编码问题引起的折腾
2009-07-03 12:43:00
django做form表单的数据验证过程详解
2023-11-10 12:26:13
![](https://img.aspxhome.com/file/2023/1/89421_0s.png)
Python实现的ini文件操作类分享
2022-01-01 12:46:24
Laravel框架实现发送短信验证功能代码
2024-05-03 15:29:08
![](https://img.aspxhome.com/file/2023/4/129844_0s.png)
Python-openCV开运算实例
2022-06-18 18:53:35
Pytorch之如何dropout避免过拟合
2023-11-29 15:11:05
![](https://img.aspxhome.com/file/2023/6/66776_0s.png)
python 执行终端/控制台命令的例子
2022-11-16 20:41:29
python Selenium爬取内容并存储至MySQL数据库的实现代码
2024-01-13 17:51:28
![](https://img.aspxhome.com/file/2023/5/96945_0s.png)
vuex页面刷新数据丢失问题的四种解决方式
2024-04-09 10:58:50
Python中字符串的常见操作技巧总结
2021-06-26 18:35:45
Vue3源码分析组件挂载初始化props与slots
2023-07-02 16:45:37
Pandas 数据处理,数据清洗详解
2022-05-23 16:04:23
Python 输出详细的异常信息(traceback)方式
2023-01-17 11:43:48
![](https://img.aspxhome.com/file/2023/3/89283_0s.jpg)
Javascript 动画初探(原理)
2009-02-06 15:53:00
python字符串常用方法
2023-07-12 19:01:50
帮你六步改善SQL Server安全规划全攻略
2009-01-20 15:07:00