Link to home
Start Free TrialLog in
Avatar of RavenTim
RavenTim

asked on

ColdFusion Code Validation

Can someone tell me how to add code to a cf web form that will dis allow certain characters from being entered into the form fields.  The form data is dumped into a 2005 SQL Server database.  I need to prohibit certain characters, i.e. single quotes, from being entered.  I assume you use some kind of form validation but I'm not sure how to do it.
Avatar of _agx_
_agx_
Flag of United States of America image

You can use javascript to validate on the client side, and CF replace() or a regex replace to revalidate on the server side.

But first we need to know which characters you want to allow/disallow. Use whichever set is smaller.
Avatar of RavenTim
RavenTim

ASKER

AGX:  I'm not sure about a set of charcters, however, I do know that single & double quotes have created problems when they have been passed on to the datafields.
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
Thank you!