码迷,mamicode.com
首页 > Web开发 > 详细

网页校验

时间:2018-05-15 14:06:19      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:creat   htm   输入验证   length   手机   nta   html   person   输入   

var CheckData = function () {

        var accountname = $("#AccountName").val();
        var accounttype = $("#AccountType").val();
        var mobile = $("#ContactPersonMobile").val();
        var email = $("#ContactPersonEmail").val();

        var regionid = $("#RegionID").val();
        var provinceid = $("#ProvinceID").val();
        var cityid = $("#CityID").val();

        var checkcode = $("#License").val();

        var ErrorMes = "";

        if (accountname.length == 0) {
            ErrorMes = "客户名称不能为空!\n";
            $("#AccountName").focus();
            //return false;
        }
        if (accounttype.length == 0) {
            ErrorMes += "请选择客户类别!\n";
            $("#AccountType").focus();
            //return false;
        }
        if (regionid.length == 0 || provinceid.length == 0 || cityid.length == 0) {
            ErrorMes += "请选择地域信息!\n";
            $("#RegionID").focus();
            //return false;
        }
        if (email.length == 0) {
            ErrorMes += "邮箱不能为空!\n";
            $("#ContactPersonEmail").focus();
            //return false;
        }
        if (mobile.length == 0) {
            ErrorMes += "手机不能为空!\n";
            $("#ContactPersonMobile").focus();
            //return false;
        }
        if (checkcode.length == 0) {
            ErrorMes += "请输入验证码!";
            $("#License").focus();
            //return false;
        }

        if (ErrorMes != "") {
            $("#showErr").html("<font color=red>          系统提示信息:" + ErrorMes + "</font>");
            alert(ErrorMes);
            return false;
        }

        return true;

 $("#submit").click(function () {
            var accountName = document.getElementsByName(‘AccountName‘);
            if (accountName[0].value == "") {
                alert("@res.CreateOperate_Content1");
                return false;
            }

  

  

网页校验

标签:creat   htm   输入验证   length   手机   nta   html   person   输入   

原文地址:https://www.cnblogs.com/Neil-Peng/p/9040522.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!