- 1、本文档共31页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
js正则表达式表单验证函数大全(JS regular expression form validation function Daquan)
js正则表达式表单验证函数大全(JS regular expression form validation function Daquan)
The following is a collection of JS (javasricpt) form validation function, using regular expressions to determine the legality of the content page to submit form. For some commonly used JS form validation of almost all, are written in function when we use a direct call or a simple modification can be as long as.
JS form verification has been a headache to the web designers, JS regular expressions form validation function is to solve this problem and to write, to enable the designer to liberate from the JS form validation in the complex, to improve the design and function to focus on .
*
Purpose: check the input Email address format is correct
Input:
StrEmail: String
Return:
Returns true if validated, otherwise it returns false
* /
Function checkEmail (strEmail) {
//var emailReg = /^[_a-z0-9]+@ ([_a-z0-9]+\.) +[a-z0-9]{2,3}$/;
Var emailReg = /^[\w-]+ (\.[\w-]+) *@[\w-]+ (\.[\w-]+) +$/;
If (emailReg.test (strEmail)) {
Return true;
}else{
Alert (the Email address you entered is not in the correct format! );
Return false;
}
}
*
Purpose: check the IP address format
Input: strIP:ip address
Returns: returns true if validated, otherwise it returns false;
* /
Function isIP (strIP) {
If (isNull (strIP)) return false;
Var re=/^ (\d+). (\d+). (\d+). (\d+) $/g, the regular expression / / IP address
If (re.test (strIP))
{
If (RegExp.$1 256 RegExp.$2256 RegExp.$3256 RegExp.$4256) return true;
}
Return false;
}
*
Purpose: check the input mobile phone number is correct
Input:
S: String
Return:
Returns true if validated, otherwise it returns false
* /
Function checkMobile (s) {
Var regu =/^[1][3][0-9]{9}$/;
Var re = new RegExp (regu);
If (re.test (s)) {
Return true;
}else{
Return false;
}
}
*
Purpose: check the input phone number format is correct
Input:
StrPhone: String
Return:
Returns true if validated, otherwise it returns false
* /
Function checkPhone (strPhone) {
Var phoneRegWithArea = /^[0][1-9]{2,3}-[
您可能关注的文档
- htm标签1-4(Htm tag 1-4).doc
- hugo boss为成功人士塑造专业形象(Hugo Boss creates a professional image for successful people).doc
- hurat1基因5 utr区荧光素酶表达重组体的构建(Construction of luciferase expression recombinant in hurat1 5 UTR region).doc
- hpad领衔 汉管理王科技亮相2011德国cebit展(Hpad led by Han management Wang technology unveiled 2011 German CeBIT Exhibition).doc
- html标签大全(HTML tags Daquan).doc
- hvdc(高压直流输电).doc
- hwjt系列微机励磁调节器现场测试(Field test of hwjt series microcomputer excitation regulator).doc
- hzyl更新说明(Hzyl update notes).doc
- h_hibernate对象状态(H_hibernate object state).doc
- i2c 总线规范学习笔记[原创](I2C bus standard learning notes [original]).doc
- 跨境新能源电动叉车租赁市场2025年数据平台应用案例解析报告.docx
- 2025年智能家居生态构建与用户需求满足度研究报告.docx
- 42025年教育科技企业在线教育产品营销策略研究报告.docx
- 2025年城市地下空间综合开发利用项目应急处理预案报告.docx
- 2025年跨境电商平台风险预警与风险管理指南报告.docx
- 电气电磁测试卷附答案.docx
- 2025-2026学年初中信息技术(信息科技)七年级上册沪科版教学设计合集.docx
- 直播带货助力零售业数字化转型:2025年应用策略与规范发展报告.docx
- 聚焦2025:家电制造行业出口竞争力与海外市场拓展机遇研究报告.docx
- 2025年智慧物流园区多式联运模式创新分析报告.docx
文档评论(0)