changePwd.jsp
上传用户:jhoneliu
上传日期:2022-07-31
资源大小:950k
文件大小:2k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <link href="css/mycss.css" rel="stylesheet" type="text/css">
  6. </head>
  7. <body>
  8. <%
  9. if(session.getAttribute("userid")== null || session.getAttribute("userid").equals(""))
  10. {
  11.   response.sendRedirect("index.jsp");
  12. }
  13. %>
  14. <jsp:include flush="true" page="head.jsp"/><br /><br />
  15. <form name="form1" method="post" action="userEdit.jsp" onSubmit="return check();">
  16. <br><br><br><br>
  17. <p align="center"><font size="4" color="red">修改密码</font></p>
  18.   <table width="400" border="1" align="center" cellpadding="3" cellspacing="1">
  19.     <tr>
  20.       <td width="148"><div align="right">旧密码:</div></td>
  21.       <td width="231"><input name="oldPwd" type="password" id="oldPwd" size="20" maxlength="20"></td>
  22.     </tr>
  23.     <tr>
  24.       <td><div align="right">新密码: </div></td>
  25.       <td><input name="pwd" type="password" id="pwd" size="20" maxlength="20"></td>
  26.     </tr>
  27.     <tr>
  28.       <td><div align="right">校验新密码:</div></td>
  29.       <td><input name="confirmPwd" type="password" id="confirmPwd" size="20" maxlength="20"></td>
  30.     </tr>
  31.   </table>
  32.   <p align="center">
  33.     <input type="submit" name="Submit" value="  保  存  ">
  34.   </p>
  35. </form>
  36. <br><br><br><br>
  37. <jsp:include flush="true" page="bottom.jsp"/>
  38. </body>
  39. </html>
  40. <script language="javascript">
  41. function check()
  42. {
  43. if(form1.oldPwd.value==""){
  44. alert("请输入旧密码");
  45. form1.oldPwd.focus();
  46. return false;
  47. }
  48. if(form1.pwd.value==""){
  49. alert("请输入新密码,新密码不允许为空");
  50. form1.pwd.focus();
  51. return false;
  52. }if(form1.pwd.value !=form1.confirmPwd.value){
  53. alert("新密码与校验密码不符");
  54. form1.confirmPwd.focus();
  55. return false;
  56. }
  57. return true;
  58. }
  59. </script>