![程序代码](http://www.banysky.com/images/code.gif)
<script>
function checkemail(){
var filter=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
if(!filter.test(document.form1.email.value)){
alert("邮箱格式不正确!");
document.form1.email.focus();
return false;
}
return true;
}
</script>
<form action=Reg.asp method=post name=form1 οnsubmit='return checkemail();'>
注:name=form1 中上下的form1变量别漏了.否则就检验不了了.