jquery验证手机号码和邮箱地址例子
為什么80%的碼農都做不了架構師?>>> ??
//jquery驗證郵箱?
????function checkSubmitEmail(){?
???????if($("#email").val()==""){?
????$("#confirmMsg").html("郵箱地址不能為空!");?
????$("#email").focus();?
????return false;?
???}?
???if(!$("#email").val().match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)){?
????$("#confirmMsg").html("郵箱格式不正確!請重新輸入!");?
????$("#email").focus();?
????return false;?
???}?
???return true;?
????}?
????
????//jquery驗證手機號碼?
????function checkSubmitMobil(){?
???????if($("#mobil").val()==""){?
????$("#moileMsg").html("手機號碼不能為空!");?
????$("#mobil").focus();?
????return false;?
???}?
?
???if(!$("#mobil").val().match(/^1[3|4|5|8][0-9]\d{4,8}$/)){?
????$("#moileMsg").html("手機號碼格式不正確!請重新輸入!");?
????$("#mobil").focus();?
????return false;?
???}?
???return true;?
????}
轉載于:https://my.oschina.net/liting/blog/698541
總結
以上是生活随笔為你收集整理的jquery验证手机号码和邮箱地址例子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 配置基于python的VIM环境
- 下一篇: eclipse创建maven多模块项目(