這裏是我的代碼:驗證檢查,如果密碼和確認密碼相同的工作不
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(name,"Name must be filled out!")==false)
{name.focus();return false;}
if (validate_required(country," Country must be filled out!")==false)
{country.focus();return false;}
if (validate_required(state,"State must be filled out!")==false)
{state.focus();return false;}
if (validate_required(city,"City must be filled out!")==false)
{city.focus();return false;}
if (validate_required(contact,"Contact must be filled out!")==false)
{contact.focus();return false;}
if (validate_required(emailid,"Email must be filled out!")==false)
{emailid.focus();return false;}
if (validate_email(userid,"Email is not valid")==false)
{userid.focus();return false;}
if (validate_required(password,"pasword must be filed out")==false)
{password.focus();return false;}
if (validate_required(cpassword,"Password must be confirmed")==false)
{cpassword.focus();return false;}
if(validate_required((password.value != cpassword.value),"Your password and confirmation password do not match.")==false) {
cpassword.focus();return false;
}
所有其他驗證正在努力,但不是最後一個。爲什麼是這樣以及如何解決它?
我替換了它,但它仍然不起作用 – 2010-06-22 12:54:27
「if(password.value!= cpassword.value){」add this:alert(password.value!= cpassword.value);你到了那裏? – DmitryK 2010-06-22 13:07:01
我沒有得到任何東西 – 2010-06-22 13:08:26