Skip to main content
Participating Frequently
April 11, 2007
Question

display formating text

  • April 11, 2007
  • 3 replies
  • 368 views
How to display the formatted text from access memo field using coldfusion without loosing the formating of the text
This topic has been closed for replies.

3 replies

Inspiring
April 11, 2007
double post (original in General Discussion forum)
Inspiring
April 11, 2007
You can use the <pre></pre> HTML tags to maintain line breaks and spacing (though you'll probably want to do some stylesheet work with that tag because the default style is pretty ugly). On the otherhand if all you are interested in is line breaks, you can do the following:

<cfset sFormattedString = Replace(myString, "#chr(13)##chr(10)#", "<br>", "all")>

chr(13) and chr(10) are the ASCII character codes for line break and line feed (respectively).
Inspiring
April 11, 2007
user341975 wrote:
> How to display the formatted text from access memo field using coldfusion without loosing the formating of the text

How is the text formated?

If the memo field contains HTML markup such as <h1>Hello World!</h1>,
then all you need to do is <cfoutput>#query.memoField#</cfoutput>

If it contains some other type of markup or the markup is escaped, then
other process will need to be used. But we will need to know exactly
how the data is stored in the database.