You can use refind() to look for it.  If you create a regex like
"[^a-zA-Z0-9]" to look for things that are not in that character range, and
then do logic based on that.  Like so:
<cfif refind("[^a-zA-Z0-9]",mystring) NEQ 0>
<cfset errorstring="You submitted illegal characters, please hit your back
button and try again">

Less server processing to do it client-side, though.  In the form field, you
could put a function onChange, like so:
<input type="text"
onChange="if(this.value.match(/[^a-zA-Z0-9]/)!=null){alert('you have put an
invalid value into this field'); this.focus();}">

                Jason Powers
                Fig Leaf Software
                202-797-5440


-----Original Message-----
From: Vani Kolli [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:44 AM
To: CF-Talk
Subject: need help..


Hi all,

I have a form field and i want to check if there is any special character
typed in instead of alphabets and numbers.
Is there any tag in cf to find it.

I remember doing it in Perl, but not sure of cf.

Any help would be appreciated. Thanks 

Vani
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to