0
onsubmit =「check_rfields();」在html的表單標籤中。但驗證失敗。Java Script:onsubmit =「check_rfields();」在html的表單標籤中。但驗證失敗
function check_rfields() {
var name = document.getElementById("id_rname").value;
var email = document.getElementById("id_remail").value;
var cemail = document.getElementById("id_rcemail").value;
var password = document.getElementById("id_rpassword").value;
var cpassword = document.getElementById("id_rcpassword").value;
if(name=='' || name==0
&& email=='' || email==0
&& cemail=='' || cemail ==0
&& password=='' || password==0
&& cpassword=='' || cpassword==0) {
document.getElementById("onsubmitErr").innerHTML
= "All fields arerequired";
return false;
}
return true;
}
有一次,它顯示了味精,但然後繼續......手段均告失敗...... –
你的意思是你」重新得到一個錯誤?也許你也應該包含HTML。 – Sp4cecat
「name == 0」?爲什麼在文本輸入上進行這個測試? –