Link to home
Start Free TrialLog in
Avatar of Michael Robinson
Michael RobinsonFlag for United States of America

asked on

Can anyone help me write a Reg Exp for CFINPUT Validation to prevent special char

Hi

I have a Cold Fusion form using <CFinput>  and I need to validate that the field is only:

letters - upper and lower case are OK
numbers are OK
hyphens are OK

but no special characters like  / \.,?!  spaces  etc

This field will become the name of a file.


Thx

Mike
<cfinput type="text" name="myfilename" message="  " pattern="  " validateat="onSubmit" validate="regular_expression" required="yes">

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> I about to run out the door,

    I _am_ about to run out the door   (hence the bad spelling ;-)
Avatar of Michael Robinson

ASKER

Excellent.  That worked perfectly.  Thank you very much.