Exactly what I was thinking!  
The only thing I would improve upon is loosing all those evaluates.  It's a
good thing to know when not to use them because they are fairly slow.  Don't
forget the faster array syntax if your cfserver is current: form[formname].
In this case, I don't think you need any of them.  Lastly(jeez am I long
winded or what?), It might be wise to copy and rename the custom tag.  Maybe
CF_EmbedFieldsEncoded or something. That way nobody will try and use it
without knowing about your changes.
DRE
Oops.  Wait I've got more(he keeps going and going. . .)!  That last loop is
a bit dangerous since you don't know what the user will type in.  I think
from your description, you know what fields will be so I would probably just
hardcode the urlencodedformats into the insert qry.  Finally, FYI, theres
also the javascript function called escape() which is the equivalent of
urlencodedformat.

-----Original Message-----
From: Kamie Curfman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 3:45 PM
To: CF-Talk
Subject: RE: CF_EmbedFields and Double Quotes


Thanks, Dre.  I modified the custom tag to:

<!--- Output it as a hidden field --->
<CFOUTPUT>
   <CFIF Find('"', Evaluate(#form_element_qualified#))
NEQ 0>
      <INPUT TYPE="hidden" NAME="#form_element#"
VALUE="#URLEncodedFormat(Evaluate(form_element_qualified))#">
   <CFELSE>
      <INPUT TYPE="hidden" NAME="#form_element#"
VALUE="#Evaluate(form_element_qualified)#">
   </CFIF>
</CFOUTPUT>

and then right before the insert do (I'm using
Fusebox):

<CFLOOP LIST="#StructKeyList(attributes)#" INDEX="ii">
   <CFIF IsDefined("#ii#") AND Find('%22',
Evaluate(#ii#)) NEQ 0>
      <CFSET SetVariable('attributes.' & #ii#, #URLDecode(Evaluate(ii))#)>
   </CFIF>
</CFLOOP>

and all appears well.  Thanks!

Kamie

--- Andre Turrettini <[EMAIL PROTECTED]>
wrote:
> Just urlencodedformat them when you put them back in
> the form fields.  You
> may need to modify your custom tag a bit.  DRE

=====
Kamie Curfman, Web Developer, FGM Inc.
45245 Business Court, Suite 400
Dulles, VA 20166
http://www.fgm.com

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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