标签: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