I am trying to validate confirm passwords in PHP using JavaScript by this code:
if($_POST['PasswordField']== $_POST['ConfirmPassword'] && $_POST['PasswordField']>='8')
{
echo "Succed <br>";
}
else
{
echo "filed <br>";
}
It works well with matching the two passwords, but the length of the password is not working. But if I enter a password which is less than 8 character it succeeds - why is this?
Also, how can I check password strength using JavaScript but not using Regular expressions?