Topic: Text Area Proper Handling

StoneRose    -- 02-06-2010 @ 7:59 PM
  What's the right way to insert text area info into the DB to maintain the multip-line formatting?  (Anything special on display?)

This message was edited by StoneRose on 2-6-10 @ 8:04 PM

nmiller    -- 02-07-2010 @ 12:48 PM
  when inserting into the database, decide if you want html
in the database.  If so, do this:


then the opposite when editing inside a textarea.

Nathan Miller
NM Consulting

StoneRose    -- 02-07-2010 @ 2:29 PM
  Thank you... didn't know that and it seems better (why doesn't CF just have that as a function)

But overnight I did find a solution (so far) which is
URLEncodedFormat/URLDecode and also ParagraphFormat on display (but don't need it to re-populate the te field, just decode).

dlackey    -- 02-08-2010 @ 8:14 AM
  I've actually never seen that tag before.  I will have to review it more in depth.  I've always used the approach Nathan took but with chr(10) and chr(13) as in

Going into the database

Coming from the database to the screen


StoneRose    -- 02-08-2010 @ 12:02 PM

Replaces characters in a string:

    * Single newline characters (CR/LF sequences) with spaces
    * Double newline characters with HTML paragraph tags (<p>)

A copy of the string, with characters converted.

EasyCFM.COM ColdFusion Forums :