I noticed I forgot to put my trim()'s in my form inputs for an admin area, and
dreaded coding them all in. Cause there's lotsa forms.
So I did this up and it seems to work well:
!--- Output dirty fields ---
cfloop list=#FORM.fieldnames# index=thisfield
cfoutput#FORM[thisfield]#/cfoutputbr
You might also want to prepare any text for SQL inserting if that's the final
destination for the form data. I have a UDF that does that for me. I'm sure
it's not the best method, but it prevents data from having ' or even which
can mess up input type=text form fields later. It was written a
trick for cleaning formfields
You might also want to prepare any text for SQL inserting if that's the
final destination for the form data. I have a UDF that does that for me.
I'm sure it's not the best method, but it prevents data from having ' or
even which can mess up input type=text form fields
type=text value=#htmlEditFormat(query.column)#
M!ke
-Original Message-
From: Mik Muller [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 9:53 AM
To: CF-Talk
Subject: Re: Neat trick for cleaning formfields
You might also want to prepare any text for SQL inserting if that's the
final
.
..
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
Need ColdFusion Help?
www.bennadel.com/ask-ben/
-Original Message-
From: Mik Muller [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 11:12 AM
To: CF-Talk
Subject: RE: Neat trick for cleaning formfields
Well
On Tuesday 06 Mar 2007, Mik Muller wrote:
function formIn(string) {
if (len(trim(string))) return
trim(replace(replace(string,'',quot;,all),','',all)); else
return ; }
Just a small note, but it is normally better to give a list of allowed
content, and kill everything else, such as:
6 matches
Mail list logo