87,910
社区成员
发帖
与我相关
我的任务
分享
if group_3="^(((13|15|18[0-9]{9}))$" or group_3="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" then
response.write "<script>alert('支付宝格式不对,支付宝账号只能为手机号码或邮箱,请核对账号!');history.back(1)</'script>"
response.end
End If
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
window.onload=function(){
var oTxt=document.getElementById("txt1");
var oBtn=document.getElementById("btn1");
var re=/(^1[3|5|7|8][0-9]{9}$)|(^\w+@[a-z0-9]+\.[a-z]+$)/i;
//以上 | 左边部分匹配手机号,右边部分匹配邮箱
oBtn.onclick=function(){
if(re.test(oTxt.value)){alert("合法的支付宝账号");}
else{alert("支付宝格式不对,支付宝账号只能为手机号码或邮箱,请核对账号!")};
};
};
</script>
</head>
<body>
<input type="text" id="txt1" >
<input type="button" id="btn1" value="校验">
</body>
</html>