setPwd.jsp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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-default btn-dlg-close">取消</button>
  31. <button class="btn btn-primary btn-submit" type="submit">提交</button>
  32. </div>
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. </div>
  38. </body>
  39. <script type="text/javascript">
  40. $(function(){
  41. $(".btn-submit").click(function(){
  42. if($("#setPwdForm").valid()){
  43. var targetForm=document.forms[0];
  44. $(targetForm).ajaxSubmit({
  45. type:"post",
  46. dataType:"json",
  47. success:function(json){
  48. $.tip("修改成功");
  49. var index = parent.layer.getFrameIndex(window.name);
  50. parent.$('.active').remove();
  51. parent.layer.close(index);
  52. },
  53. error:function(){
  54. alert('error');
  55. }
  56. });
  57. }
  58. });
  59. });
  60. </script>
  61. </html>