| 下载中心 | 文章中心 | 虚拟主机 | 网站开发 | 加入收藏 | 设为首页  
   本站首页 | 公司资讯 | 业内资讯 | 服务器类 | 黑客相关 | 私服技术 | 家用电脑 | 网站建设 | 局域网类 | 网吧相关 | 游戏攻略 | 编程开发 | 软件应用 | 硬件维修 | 分类
 站内搜索:
  百度热门搜索: it教育 网络教育 网站推广 创业致富 电动车 太阳能 瘦身产品 公告: 联邦电脑十周年系列操作系统,快速稳定,欢迎下载使用!
  热门阅读
  相关文章
ASP动态生成的javascript表单验证代码
作者:佚名  来源:不详  发布时间:2007-5-3 17:56:08  发布人:snlb

减小字体 增大字体

if (document."&frmName&"."&tmpArr(i)&".value.length!="&tmpArr(i+3)&")"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "4"  '必须大于指定位数的Text类型
  findJS="if (document."&frmName&"."&tmpArr(i)&".value.length<"&tmpArr(i+3)&")"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "5"  '必须为Email的Text类型
  findJS="if ((!emailReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "6"  '必须为a-z或0-9的字符的Text类型
  findJS="if ((!pwdReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
"}"&vbCrlf
   Exit Function


    Case "7"  '确认密码和密码必须相等的Text类型
  findJS="if ((document."&frmName&"."&tmpArr(i)&".value)!=(document."&frmName&"."&tmpArr(i+3)&".value))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "8"  '确认以数字开头的Text类型
  findJS="if ((uidBeginReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "9"  '确认10-101212格式的电话号码
  findJS="if ((!phoneReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


    Case "10" '确认只包含英文字母及"-","_"在内的Text。(即不包括中文及其他特殊字符)
  findJS="if ((uidReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
         "{"&vbCrlf&_
         "window.alert ('"&tmpArr(i+2)&"');"&vbCrlf&_
"document."&frmName&"."&tmpArr(i)&".select();"&vbCrlf&_
         "document."&frmName&"."&tmpArr(i)&".focus();"&vbCrlf&_
"return false;"&vbCrlf&_
         "}"&vbCrlf
   Exit Function


 Case "11"  '确认只包含数字及"-"在内的Text类型(电话号码及传真常用)
  findJS="if ((phoneDetailReg.test(document."&frmName&"."&tmpArr(i)&".value))&&(document."&frmName&"."&tmpArr(i)&".value!=''))"&vbCrlf&_
    

上一页  [1] [2] [3] [4]  下一页

[ ] [返回上一页] [打 印] [收 藏]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 网站地图
  联邦电脑版权所有 Copyright©1996-2004 联邦电脑 All Rights Reserved  
   xkej@sina.com 业务联系:0516-88380202 88085202 QQ: 81566563  
  苏ICP备05045772号 当前在线人数: