Link to home
Start Free TrialLog in
Avatar of bolox
bolox

asked on

Textarea get correct CR

i have wizzed through the search and found a few of these but i have no idea what i have to do.

Here we go.

I have access2000, using text or memo for this field

i use the following:

<form action=this.asp method=post>
<TEXTAREA locked NAME="text_area" ROWS="10" COLS="40"></TEXTAREA>
SUBMIT BUTTON
</form>

then:

rsdatabase.addnew
rsdatabase("infohere")= request("text_area")
rsdatabase.update


all seems fine.

when i use this:

response.write rsdatabase("infohere")

it changes this informationi typed into the textarea...

Hello
My
Name
Is
Bolox

into this:

Hello My Name Is Bolox

HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE...........HELP ME PLEASE

PLEASE NOT MY NAME IS BOLOX FOR A REASON.
(that is why this question is 75 points)




ASKER CERTIFIED SOLUTION
Avatar of _marko_
_marko_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of _marko_
_marko_

Or with this:

<PRE>
<%
     Response.Write rsdatabase("infohere")
%>
</PRE>

Marko
marko's answer should work, if you are having the problem when trying to display this information in a non-textarea (i.e. in the actual HTML portion of a page).

the problem here, is that Textarea's recognize the CRLF characters (chr(10) & chr(12)) which is the "new line" characerset, basically. whereas HTML simply recognizes this as white space (characters that are non-printable) and interprets them as trash - so it does nothing with them.

using the replace function, you can remove all of the vbCRLF (a VB constant - cariage return, line feed) characters from your text and replace them with HTML line breaks: <br>

Its happenign b'cos you are pressing <CR>. Don't put that, instead put WRAP in textarea e.g.
<TEXTAREA locked NAME="text_area" ROWS="10" COLS="40" Wrap></TEXTAREA>
It will automatically wrap and you dont have to press enter to go to next line
Avatar of bolox

ASKER

that's the one,...

points are all yours

BTW what does <pre> do ???

email me direct if you wish


gavin.holmes@commodore.co.uk

thanx again