For example:
A user submits a form with a <textarea name="mytext" cols="35" rows="2"></textarea> and presses ENTER within it. How would I replace the CR-LF with a <br />?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CF has a function for this called ParagraphFormat():
From the help docs –
Replaces characters in a string:
<p>)It may do more than you want in that it also looks for double line breaks and adds
<p>and</p>tags.Ben also has an enhanced version (a UDF) called paragraph2 that would be easy to modify to get the exact affect you want. Here’s the link:
http://www.cflib.org/udf/ParagraphFormat2