因为服务器响应比较慢,用户提交表单后会等待一段时间,可能会造成用户以为没反应重复的点击提交按钮。
以下是HTML网页特效代码,点击运行按钮可查看效果: <!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> <script type="text/javascript"> function checkFrom() { var o = document.test; if(o.uname.value == "") { alert("不能为空!"); this.onfocus(); } else { o.bott.disabled = true; } } </script> </head> <body> <form name="test" action="" method="post" onsubmit="return checkFrom();"> <label for="uname">呢称:</label><input type="text" name="uname" /> <input type="submit" name="bott" value="提交" /> </form> </body> </html> 欢迎访问阿里西西网页特效代码站,js.alixixi.com [提示:可先修改代码再按运行]