Validate size of but for encrypted password..

Hi, I am wondering how people will validate the size of a password field.. when I use validate_size_of it always pass because the encrypted password is almost longer than 8 characters.. so how does people force users to enter a 8 char password?


Wite an javascript function which would force the user to enter atleast 8 charachters..

Hi, you’re actually validating the input to your application instead of the representation in your database. You’re correct in saying the encrypted password is longer than the input entered by the user. Next, I would only check the length of the password in the following scenarios:

o user registration/creation

o user password change/reset

Otherwise, you shouldn’t be checking the length of the password.

Good luck,