Skip to content

Instantly share code, notes, and snippets.

@randy-johnson
Created July 26, 2012 18:48
Show Gist options
  • Save randy-johnson/3183766 to your computer and use it in GitHub Desktop.
Save randy-johnson/3183766 to your computer and use it in GitHub Desktop.
Username Validation
<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