CRLF characters in HTML page ?

D

Dorian

MS I'm formatting an email in HTML format with data from my MS Access DB. All
is fine except the text from text fields which contains carriage return-line
feeds is unformatted. Does anyone know if there is some way to make the HTLM
recognize the CRLF characters and format the text column data correctly?
Thanks.
 
E

Evertjan.

=?Utf-8?B?RG9yaWFu?= wrote on 04 dec 2008 in
microsoft.public.inetserver.asp.general:
MS I'm formatting an email in HTML format with data from my MS Access
DB. All is fine except the text from text fields which contains
carriage return-line feeds is unformatted. Does anyone know if there
is some way to make the HTLM recognize the CRLF characters and format
the text column data correctly? Thanks.

vbs:

newText = replace(oldText, vbCrLf, "<br>")

jscript:

var newText = oldText.replace(/\n/g,'<br>');
 
D

Dave Anderson

Dorian said:
MS I'm formatting an email in HTML format with data from my MS Access DB.
All is fine except the text from text fields which contains carriage
return-line feeds is unformatted. Does anyone know if there is some way
to make the HTLM recognize the CRLF characters and format the text column
data correctly?

You can use replace those CRLF instances with <br> elements. Assuming you
are using an ADODB.Recordset to grab the data:

JScript -----
outputText += RS.Fields("myTextField").Value.replace(/\r\n/g,"<br/>")

VBScript -----
outputText = outputText + _
Replace(RS.Fields("myTextField").Value, vbCrLf, "<br/>")


JScript String.replace:
http://msdn.microsoft.com/en-us/library/t0kbytzc(VS.85).aspx
JScript Regular Expression Object:
http://msdn.microsoft.com/en-us/library/h6e2eb7w(VS.85).aspx

VBScript Replace:
http://msdn.microsoft.com/en-us/library/238kz954(VS.85).aspx

ADO API Reference:
http://msdn.microsoft.com/en-us/library/ms807498.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top