setPwd2.jsp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!doctype html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <%@ include file="../../common/head.jsp"%>
  8. </head>
  9. <body>
  10. <div class="wrapper wrapper-content">
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <cs:form_validate formId="setPwdForm"/>
  14. <form class="form-horizontal" action="changePwd.cs" id="setPwdForm" method="POST">
  15. <input type="hidden" value="${user.id}" name="id" id="id">
  16. <div class="form-group">
  17. <label class="col-sm-3 control-label">新密码:</label>
  18. <div class="col-sm-4">
  19. <input id="pwd" type="password" name="pwd" class="form-control" validate="{required:true}" validateMessage="{required:'请输入密码'}" >
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-sm-3 control-label">确认密码:</label>
  24. <div class="col-sm-4">
  25. <input id="confpwd" type="password" name="confpwd" class="form-control" validate="{required:true,equalTo:'#pwd'}" validateMessage="{required:'请输入确认密码',equalTo:'密码与确认密码必须相同!'}" >
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <div class="col-sm-4 col-sm-offset-3 pull-left">
  30. <button class="btn btn-primary btn-submit" type="submit">提交</button>
  31. </div>
  32. </div>
  33. </form>
  34. </div>
  35. </div>
  36. </div>
  37. </body>
  38. <script type="text/javascript">
  39. $(function(){
  40. $(".btn-submit").click(function(){
  41. if($("#setPwdForm").valid()){
  42. var targetForm=document.forms[0];
  43. $(targetForm).ajaxSubmit({
  44. type:"post",
  45. dataType:"json",
  46. success:function(json){
  47. $.tip("修改成功");
  48. var index = parent.layer.getFrameIndex(window.name);
  49. parent.$('.active').remove();
  50. parent.layer.close(index);
  51. },
  52. error:function(){
  53. alert('error');
  54. }
  55. });
  56. }
  57. });
  58. });
  59. </script>
  60. </html>