Need help validating a form field server side
Sorry for the entry level question but how can I validate a text field server side
to check if it contains at least one capital letter, one number and one character?
Thanks
Sorry for the entry level question but how can I validate a text field server side
to check if it contains at least one capital letter, one number and one character?
Thanks
andy99 wrote:
Sorry for the entry level question but how can I validate a text field server side
to check if it contains at least one capital letter, one number and one character?
...
I meant special characters like @#$%^&*
<!--- The pound sign(#) is a special Coldfusion symbol, and is
escaped with #. The dollar($), caret(^) and asterisk(*) are
special regex characters, and so are escaped with a backslash(\). --->
<cfset specialChars="[@##\$%\^&\*]">
<cfset testString="asdf@123.com">
<cfif REFind("[A-Z]",testString) GT 0 and REFind("[0-9]",testString) GT 0 and REFind(specialChars,testString) GT 0>
There's a match.
<cfelse>
There's no match.
</cfif>
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.