码迷,mamicode.com
首页 > 移动开发 > 详细

js 邮箱,手机电话验证

时间:2018-01-25 00:15:27      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:return   line   keyword   blog   alert   格式   top   电话   格式不正确   

  1. var mail=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;  
  2. var tel=/^(\d3,4|\d{3,4}-)?\d{7,8}$/;  
  3. var phone=/^1[34578]\d{9}$/;  
  4. if(tjPhone.match(phone)==null){  
  5.     alert("您的手机格式不正确");  
  6.     return;  
  7. }   
  8. if(tjTel.match(tel)==null){  
  9.     alert("您的固定电话格式不正确");  
  10.     return;  
  11. }   
  12. if(tjEmail.match(mail)==null){  
  13.     alert("您的邮箱格式不正确");  
  14.     return;  

js 邮箱,手机电话验证

标签:return   line   keyword   blog   alert   格式   top   电话   格式不正确   

原文地址:https://www.cnblogs.com/duanqiao123/p/8343908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!