By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,705 Members | 2,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,705 IT Pros & Developers. It's quick & easy.

Maintaining Line Breaks when Writing from Database / HTML Encoding?

P: 76
Trying to migrate from ASP classic to ColdFusion and was wondering how to handle this. A form has a text area that submits to a database and stores a memo that can later be viewed. How can I display the field on the page while maintaining all the style information i.e. line breaks and spacing entered into it?

Of course the <pre> tag works but then it brings up other formatting issues.
May 1 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Line breaks are represented in Coldfusion by:
Expand|Select|Wrap|Line Numbers
  1. #Chr(10)##Chr(13)#
so just do a replace with the "all" parameter to convert those characters in your field to "<br>" (HTML line break).
May 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.