,我有我的網頁上的驗證碼是:表單驗證使用javascript
function validateForm() {
with (document.contactform) {
var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
if (name.value == "") alertMsg += "\nName";
if (email.value == "") alertMsg += "\nEmail";
if (message.value == "") alertMsg += "\nMessage";
if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n") {
alert(alertMsg);
return false;
} else {
return true;
}
}
}
此外,我已經添加了onsubmit="return validateForm()"
到我的表格節並沒有什麼似乎工作。你可以在http://obliqueinteractive.com/contact.html
查看源頁面任何幫助,將不勝感激 感謝
請把你的代碼代碼標籤。因爲它是html/javascript我們看不到它。我會編輯但沒有足夠的認可 – Ori 2009-08-13 20:40:43