Validation to check if password and confirm password are same is not working
<p>Here's my code:</p>

<pre><code>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;


}
</code></pre>

<p>All other validations are working but not the last one. Why is that so and how to fix it?</p>
