Forum Moderators: open

Message Too Old, No Replies

Textarea - Handeling the Line Break

I can convert characters to chr(?) but what about line breaks

         

chris_f

6:27 pm on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Guys,

I use line's like

MsgContent = Replace(MsgContent, "'", "' & Chr(39) & '")

to stop ' from breaking my database insert queries. I am looking to do the same for the return key. At the minute, if someone presses return in my textarea it is converted into nothing. I am looking to convert it into either vbcrlf or <br>. How would I represent the line break in the above code?

Chris

chris_f

6:36 pm on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No worry.

Fixed using

MsgContent = Replace(MsgContent, Chr(13), "<br>")

Chris.

joshie76

6:35 pm on Oct 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



or

Replace(MsgContent, vbcrlf, "<br>")