[thelist] PHP: How to detect a line break in a textfield
Joshua Olson
joshua at waetech.com
Tue Feb 25 08:15:00 CST 2003
----- Original Message -----
From: "Chris Marsh" <chris at ecleanuk.com>
Sent: Tuesday, February 25, 2003 9:07 AM
> sText = Request.Form("Text")
> sText = Replace(sText, vbCrLf, "<br />")
>
> Or:
>
> sText = Replace(sText, vbCrLf & vbCrLf, "</p>" & vbCrLf & "<p>")
> sText = Replace(sText, vbCrLf, "<br />" & vbCrLf)
> sText = "<p>" & vbCrLf & sText & vbCrLf & "</p>" & vbCrLf
Chris,
If the user is allowed to enter simple HTML in the text area, such as
ordered-lists, how could you adapt this strategy to not insert <br />
between list elements?
-joshua
More information about the thelist
mailing list