pwsearchcheck.js
来自「泡泡堂服务端内有建站说明,喜欢玩泡泡堂的朋友下载开发.」· JavaScript 代码 · 共 130 行
JS
130 行
<!--
function checkValue(fm)
{
var memb_ju = fm.jumin1.value + fm.jumin2.value;
if (fm.name.value=="") {
alert("请填写您的姓名") ;
fm.name.focus() ;
return false ;
}else if (Check_jumin(memb_ju) == true) {
alert ("身份证填写错误.");
fm.jumin1.focus();
return false ;
} else if (fm.jumin1.value=="" || fm.jumin2.value=="") {
alert("身份证不能为空") ;
fm.jumin1.focus() ;
return false ;
} else if (fm.email.value=="") {
alert("Email不能为空") ;
fm.email.focus() ;
return false ;
}
return true ;
}
function Check_jumin (it)
{
IDtot = 0;
IDAdd="234567892345";
for(i=0;i<12;i++)
{
IDtot=IDtot + parseInt(it.substring(i,i+1))*parseInt(IDAdd.substring(i,i+1));
}
IDtot=11-(IDtot%11);
if(IDtot==10)
{
IDtot=0;
}
else if(IDtot==11)
{
IDtot=1;
}
if(parseInt(it.substring(12,13))!=IDtot)
{
return true;
}
else
{
return false;
}
}
function checkLength(fl) {
if (fl.value=="") return false;
if (fl.name=="name") {
if (fl.value.length<2) {
alert("姓名不能少于2位.") ;
fl.focus() ;
return false ;
}
}
else if (fl.value.length <= 3) {
alert("不能少于或等于3位.") ;
fl.focus() ;
return false ;
}
else if (fl.value.length > 8) {
alert("不能大于8位.") ;
fl.focus() ;
return false ;
}
}
function checkRegno(fl) {
var year = "19";
var month = "";
var day = "";
tmp = fl.name ;
t = fl.value ;
if (fl.value=="") return false;
if (tmp=="jumin1" && fl.value.length<=5) {
alert("身份证填写错误.") ;
fl.focus() ;
return false ;
}
for(i=0;i<t.length;i++)
if (t.charAt(i)<'0' || t.charAt(i)>'9') {
alert("身份证只能为数字.") ;
fl.value="";
fl.focus() ;
return false ;
}
return true;
}
function validatenum(e1)
{
var num="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@._-";
e1.returnValue = true;
for (var i=0;i<e1.value.length;i++)
if (-1 == num.indexOf(e1.value.charAt(i)))
e1.returnValue = false;
if (!e1.returnValue)
e1.className="badvalue";
else
e1.className="";
}
function checkamt(f2)
{
validatenum(f2);
if(f2.className != ""){
f2.value="" ;
f2.focus() ;
return false ;
}
}
//-->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?