cfproperty validateparams help?
Hi! I'm trying to figure out what I'm doing wrong here. I'm setting up ORM on a table. I'm using the same regex to validate serverside and clientside, but when I submit and a value passes clientside validation, I get an error:
The value does not match the regular expression pattern provided.
Here's the property in question:
<cfproperty name="name" fieldtype="column" column="user_name" length="16" ormtype="string" update="true" insert="true" optimisticlock="true" validate="regex" validateparams="{ minlength=6, maxlength=16, pattern=[A-Za-z0-9_] }">
The input going into this is this:
<cfinput name="username" maxlength="16" length="16" required="true" message="Invalid Username" tooltip="Your username must be between six and sixteen characters and can include only letters, numbers, and underscores." validate="regex" validateat="onSubmit" type="text" pattern="[A-Za-z0-9_]">
And then sticking them together:
<cfscript> user = EntityNew("User"); user.setname("formdata.username"); EntitySave(user); ormflush(); </cfscript>
Since I'm using the same regex both places, I'm not sure why an error is being thrown? The client-side validation seems to be working perfectly, so did I mess something up setting up the property?
Thanks for taking a moment to read this far. I'm stumped. ![]()
