function confirmValidation() {
var confirmPass = document.getElementById('newpassword').value;
var newpass = document.getElementById('newpassword2').value;
var passLength = confirmPass.length;
if ((confirmPass == newpass) && (confirmPass != "" && newpass != "") && (passLength > 8)) {
alert("ok");
return true;
} else {
alert("no");
confirmPass.focus();
return false;
}
}
和輸入工作:返回false沒有在JavaScript驗證
<input name="register" type="submit" class="alert_button" onclick="return confirmValidation()" value="OK" />
請顯示您的HTML代碼? – Roopendra 2013-03-04 04:57:56
你在哪裏打電話給你的其他控件JS – polin 2013-03-04 04:58:13
爲什麼大多數問題都是在後期被低估的! – 2013-03-04 04:59:22