[thelist] Cold Fusion: Text to HTML?

aardvark roselli at earthlink.net
Sat Aug 26 20:04:21 CDT 2000


<tip type="ASP">
To substitute a hard return from a <textarea> form submission (or other text string) with a <br>:
   Replace(TextField,vbcrlf,"<br>")
This accounts for single returns and double returns, keeping the formatting the user entered.  It 
does not, however, wrap the individual paragraphs in a <p></p> block.

To break the contents of a <textarea> form submission (or other text string) into individual 
<p></p> blocks:
   "<p>" & Replace(TextField,vbcrlf,"</p><p>") & "</p>"

Of course, some users may use double hard returns, so you'll need to handle that.  There are a 
number of ways, including replacing all instances of double-returns first, and then replacing all 
single returns on a second pass.
</tip>

> From: Frank
> 
> [tip type ="Cold Fusion" Author="Jeff 
> <jeff at c4webdesign.com>"]
> 
> To substitute an invisible character in a string, 
> use it's ASCII value.
> Example: Replace(formtext, (CH13), "<br>", all) 
> will replace a return 
> charcter in a form.  Good for semi-wysiwyg effect.
> 
> [/tip]






More information about the thelist mailing list