signup.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. $(function(){
  2. /* $.validator.setDefaults({
  3. submitHandler: function() {
  4. alert("提交事件!");
  5. }
  6. }); */
  7. $(".signup-form").validate({
  8. /* errorPlacement:(error, element)=>{
  9. console.log(error);
  10. alert(error.text());
  11. }, */
  12. submitHandler:(form) => {
  13. $(".agree-chkbox").prop('checked',true);
  14. zeroModal.success({
  15. unique:'1',
  16. opacity:0.8,
  17. content:'success',
  18. contentDetail:'You have successfully registered',
  19. width:'300px',
  20. height:'260px',
  21. ok:false,
  22. onClosed:function(){
  23. location.href='../signin/signin.html'
  24. },
  25. onComplete:function(evn){
  26. console.log('onComplete')
  27. setTimeout(function(){
  28. zeroModal.close('1');
  29. },3000);
  30. }
  31. })
  32. }
  33. });
  34. $(".form-control").on("input",function(evn){
  35. //console.log('input');
  36. let $icon=$(this).siblings('.input-tool-icon');
  37. if($(this).val().length>0){
  38. $icon.show();
  39. }
  40. else{
  41. $icon.hide();
  42. }
  43. });
  44. $(".form-group-custom").on("click",".glyphicon-remove",function(evn){
  45. $(this).siblings('.form-control').val('');
  46. $(this).hide();
  47. });
  48. $(".form-group-custom").on("click",".glyphicon-eye-open",function(evn){
  49. $(this).siblings('.form-control').prop('type','text');
  50. $(this).removeClass('glyphicon-eye-open');
  51. $(this).addClass('glyphicon-eye-close');
  52. });
  53. $(".form-group-custom").on("click",".glyphicon-eye-close",function(evn){
  54. $(this).siblings('.form-control').prop('type','password');
  55. $(this).removeClass('glyphicon-eye-close');
  56. $(this).addClass('glyphicon-eye-open');
  57. });
  58. $(".tip-txt-link").on("click",function(){
  59. let forward=$(this).data('forward');
  60. if(forward){
  61. location.href=forward;
  62. }
  63. });
  64. $(".create-btn2").on("click",function(evn){
  65. let md=zeroModal.success({
  66. unique:'1',
  67. opacity:0.8,
  68. content:'success',
  69. contentDetail:'You have successfully registered',
  70. width:'300px',
  71. height:'260px',
  72. ok:false,
  73. onClosed:function(){
  74. ;//location.href='../signin/signin.html'
  75. },
  76. onComplete:function(evn){
  77. console.log('onComplete')
  78. setTimeout(function(){
  79. zeroModal.close('1');
  80. },3000);
  81. }
  82. })
  83. });
  84. });