<script language="javascript" type="text/javascript">
function checkForm()
{
var email=document.getElementById("email").value;
if(email=="")
{
alert("电子邮件不为空!");
document.getElementById("email").focus();
document.getElementById("email").select();
return false;
}
if (email !== "")
{
var checkOK2 = form1.email.value;
var checkStr2 = "@.";
var allValid2 = true;
var decPoints2 = 0;
var allNum2 = "";
for (i = 0; i < checkStr2.length; i++)
{
ch2 = checkStr2.charAt(i);
for (j = 0; j < checkOK2.length; j++)
if (ch2 == checkOK2.charAt(j))
break;
if (j == checkOK2.length)
{
allValid2 = false;
break;
}
if (ch2 != ".")
allNum2 += ch2;
}
if (!allValid2)
{
alert("您的信箱地址中缺少有效字符@!");
return (false);
}
}
}
</script>
JsEmail超强验证
最新推荐文章于 2024-08-27 15:59:21 发布