Also depends on the browser and operating system as some use \r and others
use \n for the new line characters.

 

The thing with using <pre> is that you don't have any control over the
spacing as you would with your <p> tags.

 

If it is just output you want, then yeah sure, <pre> will output it with the
breaks intact. If you need to have it continue with the flow and style of
the page then you will need to break it out into <p> blocks.

 

Otherwise you can try something like this....

 

function pFormat(string) {

      // (\n\r) for intenet explorer

      // (\n\n) for mozilla

      var output = REReplaceNoCase(string, "(\n\r)|(\n\n)", "<\p><p>",
"ALL");

      output = REReplaceNoCase(output, "(\n)", "<br />", "ALL");

      return "<p>#output#</p>";

}

 

 

From: Barry Beattie [mailto:[email protected]] 
Sent: Monday, 23 April 2012 12:48 PM
To: [email protected]
Subject: Re: [cfaussie] textareas the returns

 

Steve: is there any situations where <pre></pre> wouldn't work/be a good
idea? That used to be my preference.

On Mon, Apr 23, 2012 at 12:42 PM, Brian Knott <[email protected]> wrote:

Had a look at Paragraph forma but it replace single returns with spaces and
double returns with <p>.  Not sure why it replaces with spaces, but that
what the documentaion says.

Brian

 

  _____  

From: "Steve Onnis" <[email protected]>
Sent: Monday, 23 April 2012 12:23 PM
To: [email protected]
Subject: RE: [cfaussie] textareas the returns

 

Depends

 

You can use <pre> or you can use #ParagraphFormat([textareaValue])# which
will take each return and split the value into paragraphs using the <p> tag

 

Steve

 

From: Brian Knott [mailto:[email protected]] 
Sent: Monday, 23 April 2012 12:20 PM
To: cfaussie
Subject: [cfaussie] textareas the returns

 

Just a quick one guys.

If I put a return in a text area, now can I force the text to show those
returns when I display the field on a HTML page.

If I edit the vaue in a text area again the returns are there but if I just
display the value, the returns are ignored.

thanks

Brian

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

 

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:cfaussie%[email protected]> .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:cfaussie%[email protected]> .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

 

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to