各种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;
}

}

目录
相关文章
|
2月前
|
SQL
CHECK
【11月更文挑战第15天】
55 5
|
7月前
|
JSON 数据格式
【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)
【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)
57 0
|
7月前
|
Java
【ERROR】‘<>‘ operator is not allowed for source level below 1.7
【ERROR】‘<>‘ operator is not allowed for source level below 1.7
84 0
|
8月前
|
应用服务中间件 Python 容器
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
287 0
|
程序员 Go API
译|Don’t just check errors, handle them gracefully(一)
译|Don’t just check errors, handle them gracefully
87 0
|
Java Go API
译|Don’t just check errors, handle them gracefully(二)
译|Don’t just check errors, handle them gracefully(二)
105 0
|
Linux
WARNING: Re-reading the partition table failed with error 22: Invalid argument
在划分磁盘分区时,遇到错误“WARNING: Re-reading the partition table failed with error 22: Invalid argument” 如下所示: [root@DB-Server u02]# fdisk -l   Disk /dev/sda: 500.
2551 0
|
C语言
[Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode 解决方法
[Error] ‘for’ loop initial declarations are only allowed in C99 or C11 mode [Note] use option -std=c99,-std=gnu99,-std=c11 or-std=gnu11 to compile your code
1554 0
[Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode 解决方法
gconf-sanity-check-2 exited with status 256
gconf-sanity-check-2 exited with status 256
|
安全
Error Code: 1175. You are using safe update mode and you tried to update a t
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/79677217 在安全模式下,只能根据主键来做修改,所以使用非主键修改,那么将要解除安全模式,然后再执行操作。
1664 0