密码找回功能前台js



密码找回1

密码找回2

密码找回3

密码找回4

密码找回5

密码找回6

 

/*找回密码js added by shanmao 2013-4-1*/
$(function(){
$(“.comm_button”).each(function(index){
var index = index+1;
$(this).click(function(){
var ujsname = $(“.stp1 #username”).val();
switch(index){
case 1:
if($(“.stp1 #username”).val()==””)
{
return false;
}else{
//这里ajax验证帐号是否正确。不正确alert提示。
$.post(“#”,{check:ujsname},function(data){
if(data.status==1){
$(“.showemail”).html(data.data);
gonext(index);
}else if(data.status==3){
$(“.allowemail”).hide();
$(“.noemail”).show();
gonext(index);
}else{
alert(data.info);
}
},”json”);
}
break;
case 2:
var next_fs = $(“input[name=fangshi]:checked”).val();
if(next_fs==”email”){
$(“.doemail”).show();
//发送email 的js 在这里!
if($(this).hasClass(“on”)){
$.post(“#”,{username:ujsname},function(data){
if(data.status==1){
gonext(index);
}else{
alert(data.info);
}
},”json”);
}else{
alert(“验证邮件发送中……”);
}
//gonext(index);
}else if(next_fs==”question”){
$(“.doquestion”).show();
}else if(next_fs==”faq”){
alert(“请联系客服邮箱 cs@mechanist.co”);
return false;
}else{
return false;
}
break;
case 3:
if($(“.stp3 #answer”).val()==””)
{
return false;
}else{
//这里ajax测试问题是否正确。正确返回true不正确返回false
}
break;
case 4:
$.post(“#”,{new_password:$(“.stp4 input[name=password]”).val(),retype_new_password:$(“.stp4 input[name=re_password]”).val()},function(data){
if(data.status==1){
alert(data.info);
window.location.href=”__APP__/Public/dologout”;
}else{
alert(data.info);
}
});
break;
}
});
})
$(“img.ajaxload”).ajaxStart(function(){
$(this).show();
$(“.comm_button”).removeClass(‘on’);
});
$(“img.ajaxload”).ajaxStop(function(){
$(this).hide();
$(“.comm_button”).addClass(‘on’);
});
<{if $newpass==1}>
$(“.reset_password”).hide();
$(“.stp4”).show();
<{/if}>
})

 

功能实现 点击这里查看:http://www.mjyx.com/Public/forgotPassword