各种check

简介: 各种check,用onblur触发 function checkPhoneNum() {var phonenum = document.getElementById("phonenum").

各种check,用onblur触发

function checkPhoneNum() {
var phonenum = document.getElementById("phonenum").value;
var phoneinfo = document.getElementById("phoneinfo");
if (phonenum.length == null || phonenum == "") {
phoneinfo.innerHTML = "";
return true;
} else if (phonenum.search("^[0-9]+(\\-[0-9]+)*?$") == -1
|| phonenum.length > 20) {
phoneinfo.innerHTML = "";
phoneinfo.innerHTML = "<fmt:bundle basename='messages'><fmt:message key='js.phonenum.info'></fmt:message></fmt:bundle>";
return false;
}
phoneinfo.innerHTML = "";
phoneinfo.innerHTML = "<img src='../img/dui.jpg'>";
return true;
}

function checkShopname() {
var shopname = document.getElementById("shopname").value;
var shopnameinfo = document.getElementById("shopnameinfo");
if (shopname.trim() == null || "" == shopname.trim()) {
shopnameinfo.innerHTML = "";
shopnameinfo.innerHTML = "<fmt:bundle basename='messages'><fmt:message key='js.shopname*.info'></fmt:message></fmt:bundle>";
return false;
} else if (shopname.trim().length > 20) {
shopnameinfo.innerHTML = "";
shopnameinfo.innerHTML = "<fmt:bundle basename='messages'><fmt:message key='js.shopname.info'></fmt:message></fmt:bundle>";
return false;
} else {
document.getElementById("shopname").value = shopname.trim();
shopnameinfo.innerHTML = "";
shopnameinfo.innerHTML = "<img src='../img/dui.jpg'>";
}
return true;
}

function checkEmail() {
var email = document.getElementById("email").value;
var emailinfo = document.getElementById("emailinfo");
//对电子邮件的验证
//var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if (email.search(/^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\.(?:com|cn)$/)!= -1) {
emailinfo.innerHTML = "";
emailinfo.innerHTML = "<img src='/trlol/img/dui.jpg'>";
return true;
}else{
emailinfo.innerHTML = "";
emailinfo.innerHTML = "<fmt:bundle basename='messages'><fmt:message key='js.emailnum.info'></fmt:message></fmt:bundle>";
return false;
}

}

目录
相关文章
|
3月前
|
缓存 数据安全/隐私保护 Windows
ECDSA host key for ... has changed and you have requested strict checking.Host key verification fail
ECDSA host key for ... has changed and you have requested strict checking.Host key verification fail
|
网络安全 开发工具
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
779 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
|
Java Android开发
is not allowed for source level below 1.7 的解决办法
is not allowed for source level below 1.7 的解决办法
126 0
gconf-sanity-check-2 exited with status 256
gconf-sanity-check-2 exited with status 256
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
OPA 11 - how is check called in my iClickTheCreateButton
Created by Wang, Jerry, last modified on Nov 08, 2015
124 0
OPA 11 - how is check called in my iClickTheCreateButton
An example to fix Generic stop set error status in tcode SMQ1
An example to fix Generic stop set error status in tcode SMQ1
112 0
An example to fix Generic stop set error status in tcode SMQ1
|
安全
Error Code: 1175. You are using safe update mode and you tried to update a t
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/79677217 在安全模式下,只能根据主键来做修改,所以使用非主键修改,那么将要解除安全模式,然后再执行操作。
1608 0
|
关系型数据库 网络虚拟化
|
.NET 开发框架 数据建模