Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paragraph Output 1

Status
Not open for further replies.

tempoman

Programmer
May 9, 2000
41
0
0
AU
Can someone help me output a paragraph of text in nice way.<br>This is what I am trying to do.<br>I have the user enter in paragraphs into a textarea with wrap=physical. What I want to do is when displaying the contents of the textarea the paragraphs should put a &lt;CR&gt; at the end of the screen resolution.<br><br>For example:<br><br>Can someone help me output a paragrap (end of screen) <br>But what i would like is:<br>----------------------------<br>Can someone help me output a<br>paragrah screen, please.<br><br>Thank You<br><br><br><br>
 
HTML output should wrap anyway, unless you're using a &lt;PRE&gt; tag...<br><br>You could try:<br><br>&lt;cfoutput&gt;<br>&nbsp;&nbsp;#paragraphformat(mytext)#<br>&lt;/cfoutput&gt;<br><br>or<br>&lt;cfset mytext=Replace(mytext, &quot;#chr(13)##chr(10)#&quot;, &quot;&lt;br&gt;&quot; , &quot;all&quot;)&gt;<br>&lt;cfoutput&gt;<br>&nbsp;&nbsp;#mytext#<br>&lt;/cfoutput&gt;<br><br>Hope this helps...
 
I had the same problem and got your second solution to work. I'm not exactly sure why ... any info you can give on that?
 
When outputting the string, you're basically outputting a piece of html code. Although the string contains line breaks, your browser will treat your string just like any other piece of html and ignore them. The replace function above converts line breaks (#chr(13)##chr(10)#) with html break commands (<br>). This way, the browser sees where to break up the lines....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top