Thursday, February 16, 2012 Preserving carriage returns when displaying textarea content
When displaying textarea content on a web page carriage returns are ignored resulting in the content appearing on a single line.
In ColdFusion to ensure the content appears as intended you can replace carriage returns with BR tags like so:
Tags
Share
Comments
Thursday, February 16, 2012 John Whish
Just to make life difficult, Windows uses \r\n, *nix (including OSX) uses \n, pre OSX Mac used \r!
So to trap all potential versions, this should work:
REReplaceNoCase( your_form_field, "(\r\n|\n|\r)", "
", "all" );
Thursday, February 16, 2012 Simon Bingham
Thanks John. Bloody Macs! ;)