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

}

目录
相关文章
|
1月前
|
网络安全
出现“Host key verification failed”错误--解决
遇到“Host key verification failed”错误,通常是因为远程主机密钥发生变化,与本地保存的信息不符。这种情况可能是远程主机系统更改或重装等原因导致的。解决方法是根据提示使用`ssh-keygen -f "/root/.ssh/known_hosts" -R "[10.61.0.152]:29022"`命令移除旧的密钥信息,然后重新尝试连接。
78 5
|
3月前
|
Linux 开发工具
You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofi
linux配置环境变量操作失误出现:/usr/libexec/grepconf.sh: line 5: grep: command not found 的解决办法
64 2
|
11月前
|
网络安全 Docker 容器
ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule
ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule
|
网络安全 开发工具
【解决方案】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.
982 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
gconf-sanity-check-2 exited with status 256
gconf-sanity-check-2 exited with status 256
An example to fix Generic stop set error status in tcode SMQ1
An example to fix Generic stop set error status in tcode SMQ1
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 在安全模式下,只能根据主键来做修改,所以使用非主键修改,那么将要解除安全模式,然后再执行操作。
1639 0
|
关系型数据库 网络虚拟化
|
.NET 开发框架 数据建模