The following code (specifically, the Replace() function) will replace all
CRLFs (Carriage Return-Line Feeds) with a <BR> allowing it to display
properly in a web browser.

        <CFSET TextFromDatabase = "foo">

        <CFSET CRLF = Chr(13) & Chr(10)>
        <CFSET HTMLFormattedText = Replace(TextFromDatabase, CRLF, "<BR>", "ALL")>

        <CFOUTPUT>#HTMLFormattedText#</CFOUTPUT>

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


> -----Original Message-----
> From: Russ [mailto:russ@;unrealisticexpectations.com]
> Sent: Monday, November 11, 2002 3:30 PM
> To: CF-Talk
> Subject: Retrieving CRs from the database
>
>
> I'm pulling content from my database that has been inputted via a form.
> When I output as HTML, well, let's just say I don't want to do that.
>
> Instead, I'd like to understand how to recognize a CR from the database
> and treat it as a <BR> or <P> as necessary.
>
> Has anyone worked on this or can give me some advice as to how to
> perform?
>
> Thanks,
>
> Russ
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to