//判断手机是否正确
function isnum1(id) {
var str = document.getElementById(id).value;
if (str != "" && str != null) {
var zz = /^13[0-9]{1}[0-9]{8}$|^15[0-9]{1}[0-9]{8}$|^18[8-9]{1}[0-9]{8}$/;
if (!str.match(zz)) {
alert("手机格式不正确!");
document.getElementById(id).value = "";
var txt = document.getElementById(id);
txt.focus();
}
}
}
//判断电话是否正确
function isnum2(id) {
var str = document.getElementById(id).value;
if (str != "" && str != null) {
var zz = /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/;
if (!str.match(zz)) {
alert("电话格式不正确!");
document.getElementById(id).value = "";
var txt = document.getElementById(id);
txt.focus();
}
}
}