點擊提交按鈕後,表單域驗證和提交完成,但表單域仍未被清除。那麼如何在提交按鈕之後清除表單的字段是按?表單提交後清除表單文件
function validateContact() {
var e = document.cform.email.value;
atpos = e.indexOf("@");
dotpos = e.lastIndexOf(".");
if (fn == "" || !isNaN(fn)) {
alert("Invalid First Name");
document.cform.fname.focus();
return false;
}
}
我驗證註冊代碼例如。電子郵件和密碼,但是在哪裏編寫重置代碼,例如document.form_name.reset(); – Ambarish
你可以請你發佈你的'提交'行爲的代碼嗎? –
function validateContact() { var e = document.cform.email.value; atpos = e.indexOf(「@」); dotpos = e.lastIndexOf(「。」); (「Invalid First Name」);如果(fn ==「」||!isNaN(fn)) {} document.cform.fname.focus(); 返回false; } } – Ambarish