Use the approach in the link I posted. It is a solid approach to showing the user the password policy (I hate it when a password I enter doesn’t meet a sites policy but they don’t tell the policy) as well as showing them when they have completed each portion of the policy individually and avoids errors by detecting spaces in the password.