posts - 325,  comments - 25,  trackbacks - 0

function strChinese(str){
 var pattern = /[^\u4E00-\u9FA5]/;
 return !pattern.test(str);
}
function isPhoneValied(phone){
 for(i=0;i<phone.length;i++){
  tmpc=phone.charAt(i);
  if(tmpc>='0'&&tmpc<='9'){
  }else if(tmpc=='-'||tmpc=='#'||tmpc=='*'){
  }else{
   return false;
  }
 }
 return true;
}
function isRnameValied(realname){
 for(i=0;i<realname.length;i++){
  tmpc=realname.charAt(i);
  if(tmpc>='a'&&tmpc<='z'){
  }else if(tmpc>='A'&&tmpc<='Z'){
  }else if(strChinese(tmpc)){
  }else{
   return false;
  }
 }
 return true;
}

function isEmailValidate(emails){
 for(i=0;i<emails.length;i++){
  tmpc=emails.charAt(i);
  if(tmpc>='a'&&tmpc<='z'){ 
  }else if(tmpc>='A'&&tmpc<='Z'){
  }else if(tmpc>='0'&&tmpc<='9'){
  }else if(tmpc=='@'||tmpc=='.'||tmpc=='_'){
  }else{
   return false;
  }
 }
 return true;
}
function isCodeValied(code){
 for(i=0;i<code.length;i++){
  tmpc=code.charAt(i);
  if(tmpc>='0'&&tmpc<='9'){
  }else{
   return false;
  }
 }
 return true;
}
function isLeapYear(year){
 if(((year%4==0)&&(year%100!=0))||(year%400==0)){
 }else{
  return false;
 }
 return true;
}

 

posted on 2008-08-31 08:29 长春语林科技 阅读(167) 评论(0)  编辑  收藏 所属分类: js

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年8月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

 

长春语林科技欢迎您!

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

相册

收藏夹

搜索

  •  

最新评论

阅读排行榜

评论排行榜