PDA

Click to See Complete Forum and Search --> : Convert line breaks into HTML


IClarke
Nov 7th, 2000, 08:09 AM
I need to display some text from a database field on my web page, but i've noticed that any line breaks etc. are lost. I thought about putting the text into a text area as this seems to maintain the correct formatting but i don't like the way it looks on the page. Is there a way to somehow convert the line breaks in the text into valid HTML or something ?

Thanks
Ian.

Serge
Nov 7th, 2000, 09:57 AM
Before displaying the text, you can replace all vbCrLf with <BR>:


<%
Dim strText

strText = Replace(RS.Fields("YourFieldName"), vbCrLf, "<BR>"
Response.Write strText
%>