How to enforce Password 6+ charactors

trend

Centurion
Joined
Oct 12, 2004
Messages
171
I am writting a vb.net program, and one of the requirements is that the password is 6+ charactors long.. How can I enforce this?

I tried doing something like:

If Len(password.text) < 5 then call errormsg

but the weird thing is that this only works on the 2 try to enter in a password... Like the user presses the submit button with a password 10charactors long, and they still get the error.. but on the 2nd try, if the password is 6+ charactors long it works....

:/

Should I be checking the pw field a different way?

thanks-Lee
 
Could you post more of your code? It is quite hard to identify a problem from just a single line of code.
Also you may want to investigate the regular expression validator control as an alternative - this will allow for client side validation as well as server side validation.
 
Back
Top