function repasswordvalid()
{
var cpassword = document.registration.repassword.value;
var passwordchk = document.registration.password.value;
if((passwordchk != cpassword) && cpassword == "")
{
alert("Cofirm password not matched..!!");
document.getElementById('repassword1').innerHTML = "The password is required.";
document.getElementById('repassword1').focus();
}
else
{
document.getElementById('repassword1').innerHTML = "";
}
}
我正在检查onBlur事件的确认密码验证。所有领域都在运作,但在这里我被卡住了。
答案 0 :(得分:0)
您可能希望条件中的或不是和,因为cpassword必须为空并且两个字段都不匹配以触发警报
if((passwordchk != cpassword) || cpassword == "")