supa charoenchit wrote:
Hello, I am having a problem validating a password field.
My requirement on my password is that it must be:
8 characters minimum length and contain at least one from each of the following groups: [a-z], [A-Z], and [0-9].
Here is what I have so far (which is not working):
[...]
<field-validator type="regex">
<param name="expression">^[a-z]+$</param>
<message>[a-z]</message>
</field-validator>
<field-validator type="regex">
<param name="expression">^[A-Z]+$</param>
<message>[A-Z]</message>
</field-validator>
<field-validator type="regex">
<param name="expression">^[0-9]+$</param>
<message>[0-9]</message>
</field-validator>
When I attempt to submit my form with correct data, it does not submit and states that I need a-z, A-Z, and 0-9. What is going on here?
Well, those regexs say a valid password must start and end with one or
more lowercase letters, must also start and end with one or more
uppercase letters and must also start and end with one or more digits.
That's obviously not possible.
If you remove the '^' and '$' characters from the expressions, you'll
just be testing that the characters appear somewhere within the
password, which I think is what you meant.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]