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

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

Simon Bingham Thanks John. Bloody Macs! ;)


Add Comment

Your email address will not be displayed on this blog.

The URL of your blog or web site.