• 首页
  • 网站建设
  • 网站推广
  • seo优化
  • ASP编程
  • PHP编程
  • 电脑网络
  • 健康知识
  • 网上商城
您的位置:首页 > ASP编程 > js邮箱验证

js邮箱验证

文章来源:互联网         发表时间:2008-3-30         浏览次数:
<html>   
<head>   
<script type="text/javascript">   
function validate_email(field,alerttxt)   
{    with (field)   
    {    apos=value.indexOf("@")   
       dotpos=value.lastIndexOf(".")   
      if (apos<1||dotpos-apos<2)      
      {alert(alerttxt);return false}   
      else {return true}   
     }
}
function validate_form(thisform)
{    with (thisform)   
{    if (validate_email(email,"邮箱格式不下确!")==false)     
{email.focus();return false}    }    }    
 </script>   
</head>
<body>   
<form action=""    onsubmit="return validate_form(this);"    method="post">   
Email: <input type="text" name="email" size="30">     
<input type="submit" value="Submit">    
</form>   
</body>
</html>
       返回顶部
如果该文章侵犯你了权益,请来信告诉之:shaheni@163.com
相关文章
CopryRight©2008 www.enbuy.com.cn All Rights Reserved
QQ:191848354  E-mail:shaheni@163.com