function checkMobile() {
            var sMobile = document.getElementById(“phone”).value
            var radio = document.getElementsByName(“type”);
            if (radio[0].checked) {
                if (!(/^1[3|4|5|7|8][0-9]\d{8}$/.test(sMobile))) {
                    document.getElementById(“warShow”).innerHTML = “请输入正确的手机号码!”;
                    return false;
                }
            }
            else {
                if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(sMobile)) {
                    document.getElementById(“warShow”).innerHTML = “请输入有效的E_mail!”;
                    return false;
                }
            }
        }

版权声明:本文为dzhjhp原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/dzhjhp/p/4707124.html