The reason you're getting that output is because HTML renders CR/LF as any
other whitespace character, i.e., a space.

You could try this:

<CFOUTPUT QUERY="getcommonnames">
<CFSET COMMONLIST = Replace(Common_Names, ",", "<br>", "ALL")>
#COMMONLIST#<br>
</CFOUTPUT>


Or this, since you know the field contains a list:
<CFOUTPUT QUERY="getcommonnames">
 <cfloop list="#COMMONLIST#" index="i">
  #i#<br>
 </cfloop>
</CFOUTPUT>

(One item can be treated like a list.)



> -----Original Message-----
> From: Shirley [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 20, 2002 4:54 AM
> To: CF-Talk
> Subject: Looping
> 
> 
>   Hello,
> 
> I have a field that stores info in a comma-delimited format. 
> The field 
> is named Common_Names. I'll use three records from this field 
> as an example:
> 
> Tall Whitetop, Tall Pepperweed, Perennial Pepperweed
> Sycamore Maple
> Porcelainberry, Amur Peppervine
> 
> After querying the database, I want to loop over these records and 
> output them in the following format, so that I can use them 
> in a Select 
> List:
> 
> Tall Whitetop
> Tall Pepperweed
> Perennial Pepperweed
> Sycamore Maple
> Porcelainberry
> Amur Peppervine
> 
> 
> I'm having problems inserting a line feed. The following code 
> strips out 
> the commas, but it doesn't insert a line feed. I end up with:
> 
> Tall Whitetop Tall Pepperweed Perennial Pepperweed
> Sycamore Maple
> Porcelainberry Amur Peppervine
> 
> 
> <CFSET CRLF = CHR(13) & CHR(10)>
> <CFOUTPUT QUERY="getcommonnames">
> <CFSET COMMONLIST = Replace(Common_Names, ",", "#CRLF#", "ALL")#>
> #COMMONLIST#<br>
> </CFOUTPUT>
> 
> I appreciate your help.
> 
> 
> 
> 
> 
> 
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to