日期:2014-05-17 浏览次数:20705 次
<%@ page language="java" contentType="text/html;charset=gb2312"%> <html> <body> 请输入用户名、密码: <form name="login" action="result.jsp" method="post"> 用户名: <input type="text" name="username" /> 密码: <input type="password" name="password" /> <input type="button" value="提交" onClick="check()" /> </form> <script type="text/javascript"> function check() { if (login.username.value == "" || login.parseword.value == "") { alert("不能为空!"); return; } window.print("adfadf"); login.submit(); } </script> </body> </html>
<%@ page language="java" contentType="text/html;charset=gb2312"%> <html> <body> <%if(request.getParameter("username") == request.getParameter("password")){ out.print("恭喜!注册成功!"); %> <script type="text/javascript"> alter("congratulations"); </script> <% }else { %> <script type="text/javascript"> alter("sb"); </script> <% } %> </body> </html>