findpasswd.js 1.1 KB

123456789101112131415161718192021222324252627
  1. function sendCode(){
  2. var userName = $("#userName").val();
  3. var phone = $("#phone").val();
  4. var param = {"userName":userName,"phone":phone};
  5. sendAsyncAjax(param,"loadCode.do?type=loadCode","text",process);
  6. }
  7. function process(data){
  8. $("#time").val(data);
  9. }
  10. function validateData(){
  11. var rs = $.validate({name:"userName",model:[{type:"require",msg:"用户不能为空!",msgBox:"userName_msg"}]});
  12. rs &= $.validate({name:"phone",model:[{type:"require",msg:"电话号码不能为空!",msgBox:"phone_msg"}]});
  13. rs &= $.validate({name:"code",model:[{type:"require",msg:"验证码不能为空!",msgBox:"code_msg"}]});
  14. rs &= $.validate({name:"password",model:[{type:"require",msg:"新密码不能为空!",msgBox:"password_msg"}]});
  15. rs &= $.validate({name:"password1",model:[{type:"require",msg:"确认密码不能为空!",msgBox:"password1_msg"}
  16. ,{type:"equals",name2:"password",msg:"确认密码与新密码不一致!",msgBox:"password1_msg"}]});
  17. return rs;
  18. }
  19. function loadCode(){
  20. var phone = $("#phone").val();
  21. if(phone==""){
  22. alert("请输入电话号码!");
  23. }else{
  24. sendCode();
  25. }
  26. }