|
-
Mar 3rd, 2001, 03:05 PM
#1
Thread Starter
Member
Hello,
Gotta small question. I am trying to convert the output of a database query, objRec("positiondescription") into HTML.
The database holds regular text, but is there an elegant
way to turn linebreaks in <br>?
I tried the HTML <pre> tag but I don't like the typewriter like font. It doesn't word wrap well, either.
Thanks so much,
Scott
-
Mar 3rd, 2001, 06:41 PM
#2
New Member
Hi,
You can use this:
Code:
Function toHTML(strText)
Dim strHTML
If IsNull(strText) Then
strHTML = ""
Else
strHTML = Replace(strText, Chr(13), "<br>")
End If
toHTML = strHTML
End Function
Then to use it:
Code:
Response.Write(toHTML(objRec("positiondescription").Value))
That should do the trick.
-
Mar 4th, 2001, 06:15 PM
#3
Thread Starter
Member
Works like a champ! Thanks so much...
Scott
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|