Created
July 26, 2012 18:48
-
-
Save randy-johnson/3183766 to your computer and use it in GitHub Desktop.
Username Validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfparam name="form.username" default=""> | |
<cfif form.username is not ""> | |
<cfif reFindNoCase("^([a-z_\d]+)$", form.userName)> | |
good | |
<cfelse> | |
empty or bad chars found | |
</cfif> | |
</cfif> | |
<cfoutput> | |
<form action="" method="post"> | |
<input type="text" name="username" value="#form.username#" /> | |
<input type="submit" name="submit" value="submit" /> | |
</form> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment