22
2021
04

原生js,注册会员必须同意协议

原生js,注册会员必须同意协议

function check(){

if (document.form1.hy_mobile.value == ""){

layer.open({

content: '手机号码必须正确输入'

,skin: 'msg'

,time: 2 //2秒后自动关闭

});

document.form1.hy_mobile.focus();

return (false);//停止往下运行

};

var hy_mobile = document.form1.hy_mobile.value 

if(!(/^1[3|4|5|6|7|8|9][0-9]\d{4,8}$/.test(hy_mobile))){

layer.open({

content: '手机号码格式不正确'

,skin: 'msg'

,time: 2 //2秒后自动关闭

});

document.form1.hy_mobile.focus();

return false;

};

if (document.form1.hy_mobile.value.length<11){

layer.open({

content: '手机号码不足11位'

,skin: 'msg'

,time: 2 //2秒后自动关闭

});

document.form1.hy_mobile.focus();

return (false);

};

if (document.form1.hy_name.value == "")

{

layer.open({

content: '姓名必须输入'

,skin: 'msg'

,time: 2 //2秒后自动关闭

});

document.form1.hy_name.focus();

return (false);

};

var val=$('input:radio[name="xy"]:checked').val();

if(val==null){

layer.open({

content: '没有同意平台协议'

,skin: 'msg'

,time: 2 //2秒后自动关闭

});

return (false);

};



};


« 上一篇下一篇 »