?? pwsearchcheck.js
字號:
<!--
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -