加入收藏 - 网站地图 - 网站搜索 -
阅读新闻

用JScript实现的Email地址验证

[日期:01-11] 来源:  作者: [字体: ]

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效|Linkweb.cn/Js|---用JScript实现的Email地址验证</title>
</head>

<body>
<form name="validation" onSubmit="return checkbae()">
Please input a valid email address:<br>
<input type="text" size=18 name="emailcheck">
<input type="submit" value="Submit">
</form>
<script nguage="JavaScript1.2">
var testresults
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^.+@.+\..{2,3}$/
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
document.validation.emailcheck.focus();
testresults=false
}
return (testresults)
}
</script>
<script>
function checkbae(){
if (document.layers||document.all)
return checkemail()
else
return true
}
</script>

</body>

</html>



评论 】 【 推荐 】 【 打印
上一篇:可以用鼠标拖动的表格
下一篇:客户端控制上传图像大小和类别示例
相关新闻       特效代码