[thelist] Textarea, hard returns, ASP, and CDOSYS

Ken Schaefer ken at adOpenStatic.com
Wed Oct 22 23:07:03 CDT 2003


Returns entered by the user in a text-area field should come out as vbCrLf

If you're sending mail out in HTML format, you'd need to replace these with
"<br>" (or "<br />")

If you're not doing that, then what you could do is loop through all the
characters in the actual value submitted by the user and dump the ASCII
character values to the screen, so you can see what's there:

Dim i
For i = 1 to Len(Request.Form("myTextArea"))

    Response.Write(Asc(Mid(Request.Form("myTextArea"), i, 1)) & " - ")

Next

Cheers
Ken

Microsoft MVP - Windows Server (IIS)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Tab Alleman" <Tab.Alleman at MetroGuide.com>
Subject: [thelist] Textarea, hard returns, ASP, and CDOSYS


I've got an html form that has a textarea field where users type the
body of an email message.

I've got an ASP script that processes the form and sends the email using
CDOSYS.

When the email arrives, the (hard) carriage-returns entered by the user
are gone.  It's all one block of text with no blank lines.

I've tried a few different things with the wrap="" parameter of the
textarea, and by REPLACE()-ing "\n" with Chr(10) in the ASP script, but
all to no avail.

Does anybody here know the best way to get hard returns entered into a
text field to translate into vbCrLf's in an ASP script?



More information about the thelist mailing list