zoukankan      html  css  js  c++  java
  • 网页校验

    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 = "客户名称不能为空!
    ";
                $("#AccountName").focus();
                //return false;
            }
            if (accounttype.length == 0) {
                ErrorMes += "请选择客户类别!
    ";
                $("#AccountType").focus();
                //return false;
            }
            if (regionid.length == 0 || provinceid.length == 0 || cityid.length == 0) {
                ErrorMes += "请选择地域信息!
    ";
                $("#RegionID").focus();
                //return false;
            }
            if (email.length == 0) {
                ErrorMes += "邮箱不能为空!
    ";
                $("#ContactPersonEmail").focus();
                //return false;
            }
            if (mobile.length == 0) {
                ErrorMes += "手机不能为空!
    ";
                $("#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;
                }
    

      

      

  • 相关阅读:
    winsows10 小技巧
    数组与智能指针
    卸载 VS2015
    Effective C++
    修改 git commit 的信息
    线程管理
    并发编程简介
    个别算法详解
    git 删除某个中间提交版本
    git 查看某一行代码的修改历史
  • 原文地址:https://www.cnblogs.com/Neil-Peng/p/9040522.html
Copyright © 2011-2022 走看看