July 22nd, 2011, 06:55 PM
Replace /n with <br>, but only once...
Hi All, Developed some code to enable users to edit a webpage. Newlines are replaced with <br>. It works fine the first time. The problem is that the users can come back and update their comments - using the code below. And for some reason I end up with double <br> <br>. and probably triple on the next edit, etc. Any thoughts?
Thanks in advance,
Comments = <cfif Len(Trim(Form.Comments)) GT 0>
'#ReReplace(Form.Comments, "\n", "<br>", "ALL")#'
ReportNumber = #ReportNumber#
July 22nd, 2011, 07:26 PM
Nevermind, I got it. Just stripped out the <br>s when they pull their comments from the DB.