求助代码跳转
我想实现验证正确就跳转到Log.html求解
程序代码:
<script language="javascript" type="text/javascript"> function changeFocus() { if(event.srcElment.type!='button'&& event.srcElment.type!='submit'&& event.srcElment.type!='reset'&& event.srcElment.type!='textarea'&& event.srcElment.type!='') event.keyCode=9; } document.onKeyDown=changeFocus; function userName() { var name=document.userform.sname.value; if(name.length<6||name.length>20) { alert("格式错误\n"+"请填写正确用户名"); } return true; } function Password() { var Word=document.userform.pass.value; if(Word.length<6||word.length>15) { alert("密码格式错误\n"+"6-15个字符"); } return true; } function Rpassword() { var Word=document.userform.pass.value; if(Word.length<6||word.length>15) { alert("密码必须相同"); } return true; } function checkEmail() { var remail=document.userform.email.value; if(remail.length==0) { alert("邮箱格式错误\n"+"请认真填写"); } if(remail.indexof("@",0)==-1) { alert("邮箱地址必须包含'@'"); } if(remail.indexof(".",0)==-1) { alert("邮箱必须包含'.'"); } return true; } function validateform() { if(userName()&&Password()&&Rpassword()&&checkEmail()) return true; if(true) { window.open("Log.html"); } else return false; } // </script>