Les,

What I do is at the top of every page processing, I loop through the FORM
scope to strip out special MS word characters, or replace them. Soemthing
like this (part of my EscapeForm() UDF):

----------------------------

for (LOCAL.Key in FORM){
        
  // Trim the field value.
  ARGUMENTS.Form[ LOCAL.Key ] = Trim(ARGUMENTS.Form[ LOCAL.Key ]);
  
  // Since we want to store regular quotes in the database, lets make 
  // sure we don't have any escaped quotes in the submitted values. 
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
""", Chr(34), "ALL");
  
  // We don't want to store lame-ass Micorosoft characters since they 
  // never display correctly on the screen cross-browser. Replace the 
  // special characters that Microsoft uses.
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8217), Chr(39), "ALL");
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8216), Chr(39), "ALL");
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8220), Chr(34), "ALL");
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8221), Chr(34), "ALL");
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8211), "-", "ALL");
  ARGUMENTS.Form[ LOCAL.Key ] = Replace(ARGUMENTS.Form[ LOCAL.Key ],
Chr(8212), "-", "ALL");
  
} 

----------------------------

The 8000+ char values are MS Word quotes and apostrophes and dashes. 

.......................
Ben Nadel 
www.bennadel.com

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 25, 2006 8:06 PM
To: CF-Talk
Subject: cfinsert and pasted crap in a textarea

Using cfinsert to add a record from an admin form.

There's a text area for a description and as long as you type directly into
it, no problem. You can put any darned thing in there you want.

Client has decided to cut 'n paste from various sources though, and when
they paste and save, it *might* look OK in their browser, but a direct
examination of the record shows the dreaded "little boxes" that come from
the MS Word version (amoung other things) of quotes...

What's the best way of solving this problem?

Do I need to quit using cfinsert in this instance and go with a regular
cfquery and htmleditformat? Or is there a better way?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241532
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to