Guest User

Untitled

a guest
May 5th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. function submitlogin1() {
  2. var userName = document.getElementById("userName1");
  3. var password = document.getElementById("password1");
  4. var rand = document.getElementById("rand");
  5.  
  6. if (userName.value == "") {
  7. alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
  8. return false;
  9. }
  10. if (password.value == "") {
  11. alert("\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a!");
  12. return false;
  13. }
  14. if (rand.value == "") {
  15. alert("\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a");
  16. return false;
  17. }
  18. //if(!checkRand()){
  19. //return false;
  20. //}
  21.  
  22. password.value = BASE64.encoder(password.value);
  23. document.getElementById("login1").submit();
  24. }
  25. function changepw() {
  26. var userName1 = document.getElementById("userName1");
  27. var password1 = document.getElementById("password1");
  28. var password2 = document.getElementById("password2");
  29. var password3 = document.getElementById("password3");
  30. if (userName1.value == "") {
  31. alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
  32. return false;
  33. }
  34. if (password1.value == "") {
  35. alert("\u65e7\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a!");
  36. return false;
  37. }
  38. if (password2.value == "") {
  39. alert("\u65b0\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a!");
  40. return false;
  41. }
  42. if (password3.value != password2.value || password3.value == "") {
  43. alert("\u65b0\u5bc6\u7801\u524d\u540e\u4e0d\u4e00\u81f4!");
  44. return false;
  45. }
  46. document.getElementById("pwchange").submit();
  47. }
  48. function showRand() {
  49. //var num = random();
  50. //document.getElementById("confirmrand").value = num;
  51. //document.getElementById("random").src = "/common/image.jsp?rand=" + num;
  52. var time = new Date().getTime();
  53. document.getElementById("random").src = "/common/image.jsp?time=" + time;
  54. }
  55. function getPassword() {
  56. var userName = document.getElementById("userName2");
  57. if (userName.value == "") {
  58. JSMessage.getMessage("16001001", function (data) {
  59. alert(data);
  60. });
  61. } else {
  62. Password.getPassword(userName.value, function (data) {
  63. alert(data);
  64. });
  65. }
  66. }
  67. function random() {
  68. var num = "";
  69. for (i = 0; i < 4; i++) {
  70. num = num + Math.floor(Math.random() * 10);
  71. }
  72. return num;
  73. }
  74. function checkRand() {
  75. if (document.getElementById("rand").value != null && document.getElementById("rand").value != "") {
  76. if (document.getElementById("confirmrand").value != document.getElementById("rand").value) {
  77. alert("\u9a8c\u8bc1\u7801\u9519\u8bef");
  78. return false;
  79. } else {
  80. return true;
  81. }
  82. } else {
  83. alert("\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a");
  84. return false;
  85. }
  86. }
Add Comment
Please, Sign In to add comment