- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>form.html</title>
-
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="this is my page">
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
- <script type="text/javascript">
- var iscommited = false;
- function dosubmit(){
- if(!iscommited){
- iscommited = true;
- return true;
- }else{
- return false;
- }
- }
- </script>
- </head>
-
- <body>
- <form action="/myday08/servlet/DoFormServlet" method="post" onsubmit="return dosubmit()" >
- 用户名:<input type="text" name="username"/>
- 密码:<input type="password" name="password" />
- <input type="submit" value="提交" />
- </form>
- </body>
- </html>
复制代码 一个表单用js为了防止重复提交,可onsubmit="return dosubmit()" 这里怎么会报错呢?求解、、
|
|