87,910
社区成员
发帖
与我相关
我的任务
分享
function get_verification_code() {
var mobile = $("input[name=mobile]").val();
if(mobile=='' || mobile==null || mobile==undefined){
alert('手机号不能为空!');
return ;
}
var isMobile=/^(?:13\d|14\d|15\d|17\d|18\d)\d{5}(\d{3}|\*{3})$/;
if(!isMobile.test(mobile)){
alert('手机号格式不对!');
return ;
};
//alert("验证码正在发送中,请您耐心等待!");
$('#get_verfication').attr("disabled",true);
var countDownOb;
var countDownTime=60;
countDownOb=setInterval(function(){
$("#get_verfication").val(countDownTime--);
if(countDownTime<=0){
$('#get_verfication').attr("disabled",false);
$("#get_verfication").val("获取验证码");
countDownTime=60;
clearTimeout(countDownOb);
};
},1000);
var name = $('input[name=name]').val();
$.ajax({
type:'post',
url:"",
data:{mobile:mobile,name:name},
dataType:'text',
success:function(result){
if(result.search(/error/i)+1)
{
alert('发送出错:\n'+result);
return ;
}
}
});
}