论坛首页 Web前端技术论坛

Javascript电话号码,邮件地址,身份证验证

浏览 1344 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2014-08-24  

Javascript电话号码,邮件地址,身份证验证插件,传入要验证的字符串,返回ture代表符合,返回false代码不符合。

使用:

document.getElementById("btnPhone").onclick=function(){  
        alert(ValidationHandler.IsPhone(document.getElementById("phoneInput").value)==true?"合法":"不合法")  
    };  
    document.getElementById("btnEmail").onclick=function(){  
        alert(ValidationHandler.IsEmail(document.getElementById("emailInput").value)==true?"合法":"不合法")  
    };  
    document.getElementById("btnIdCard").onclick=function(){  
        alert(ValidationHandler.isIDCard(document.getElementById("idCardInput").value)==true?"合法":"不合法")  
    };  

 演示地址:http://www.pengyaou.com/LegendsZ/eg/Validation.html

 js插件下载:http://www.pengyaou.com/LegendsZ/File/2014/08/22/20140822205741305.html

论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics