> Is there any way in CF to set the input type of a form field. 
> Basically I only want the user to be able to enter text and 
> not HTML in a form field?

The short answer is "not really". You can't do anything in CF to limit what
a user can put into a form field. You can, however, build server-side
validation tests in your action page to ensure that there's no HTML in the
field.

In addition, if you're using CF 5, you can include JavaScript-compliant
regular expression tests using CFFORM and CFINPUT tags - simply place your
regex in the VALIDATE attribute value of your CFINPUT tag. At least, I
believe this is new to CF 5. If you're using an older version, you could
write the JavaScript validation function yourself.

However, if you're using this for security against malicious users, you
can't rely on client-side tests such as JavaScript - they can be easily
avoided by someone with that intent.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to