function checkMobile(mobileControl){
var phone = $.trim(mobileControl.val());
if (undefined != phone && null != phone && "" != phone){
var p1 = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;
var me = false;
if (p1.test(phone))me=true;
if (!me){
mobileControl.val("");
mobileControl.focus();
return false;
}
}
return true;
}
function checkPhone(phoneControl){
var phone = $.trim(phoneControl.val());
if (undefined != phone && null != phone && "" != phone){
var regPartton=/1[3-8]+\d{9}/;
var me = false;
if (regPartton.test(phone))me=true;
if (!me){
phoneControl.val("");
phoneControl.focus();
return false;
}
}
return true;
}
js 校验电话和手机
最新推荐文章于 2023-01-17 10:22:11 发布