你没有结束页面,他还是提交上去了呀!不要把按钮的类型设为submit,当检查没有问题的时候再用form.submit()提交就好了

解决方案 »

  1.   

    改一改
    function validateform()
    {
    if (document.form.password.value!=document.form.password1.value)
    {alert("两次密码不一致,请确认您的密码!");
    document.form.password="";
    document.form.password1="";
    document.form.password.focus();
             return false;
    }
             return true;

    </script>
    表单设置如下:
    <form action="deal_regist.asp" method="post" name="form" onsubmit="return validateform();>