In addition to the ReReplace() function, as a first line of defense or if
I'm feeling lazy :-). I use javascript to make sure they cant even type the
characters I dont want them to be able to type.

It's called very easily like so:
<input type="text" name="whatever" onKeyPress="return letternumber(event)">

Put this in your head
<SCRIPT TYPE="text/javascript">
<!--
// copyright 1999 Mikodocs, Inc. http://www.mikodocs.com
// Distribute this script freely but keep this notice in place
function letternumber(e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();

// control keys
if ((key==null) || (key==0) || (key==8) ||
    (key==9) || (key==13) || (key==27) )
   return true;

// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
   return true;
else
   return false;
}
//-->
</SCRIPT>


 jon

 ----- Original Message -----
 From: "Vani Kolli" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Friday, January 12, 2001 10:44 AM
> 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