JS问题 求高手帮忙
function checkemail(){
var myReg = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
if(!myReg.test(document.form1.to.value))
{
alert('信箱格式错误!');
window.location.href="index.html";
}
}
为什么每次执行完alert 之后 下面的转向就不执行了
补充: <form id="form1" name="form1" method="post" action="mailTo.aspx">
<p><input id="name" name="name" value="" type="text" /></p>
<p><input id="add" name="add" value="" type="text" /></p>
<p>
<input id="to" name="to" value="邮箱" type="text" />
</p>
<input class="book_but" onclick="checkemail()" src="images/but_book.jpg"
type="image" name="input" />
</form>