|
 |
asp_database_setup thread: Detecting Blank lines in memo field
Message #1 by "Andrew Matheson" <amatheso@y...> on Sun, 5 Aug 2001 16:08:53
|
|
Hi.
I have just set up a simple guest book. I have a memo field
where the user can type there comments (access database). The problem is
that if the user wants to type..say..three paragraphs they can, However
when the guest book is viewed, it appears as one block of text.
Does anyone know how i can utilize code (asp) to detect blank lines
and put an html <br> in it's place to make it display properely
when the book is viewed???
Thanks,
Andrew
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 6 Aug 2001 17:42:19 +1000
|
|
New lines in the database are stored as Carriage Return, New line (vbCrLf,
or in other terms ASCII Chr(10) & Chr(13)).
Of course a browser does not render ASCII Chr(10) or Chr(13). It only
renders <html> type tags.
So, when you display the field, you should replace vbCrLf with <br />, or
alternatively <p></p> tags.
Response.Write( _
Replace(objRS("fieldname"), vbCrLf, "<br />" & vbCrLf)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Andrew Matheson" <amatheso@y...>
Subject: [asp_database_setup] Detecting Blank lines in memo field
: Hi.
:
: I have just set up a simple guest book. I have a memo field
: where the user can type there comments (access database). The problem is
: that if the user wants to type..say..three paragraphs they can, However
: when the guest book is viewed, it appears as one block of text.
:
: Does anyone know how i can utilize code (asp) to detect blank lines
: and put an html <br> in it's place to make it display properely
: when the book is viewed???
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by Arjan Bosboom <Arjan.Bosboom@d...> on Mon, 6 Aug 2001 09:20:18 +0200
|
|
<%
response.write(replace([text],vbCrLf,"<br>"))
%>
-----Original Message-----
From: Andrew Matheson [mailto:amatheso@y...]
Sent: zondag 5 augustus 2001 18:09
To: ASP Database Setup
Subject: [asp_database_setup] Detecting Blank lines in memo field
Hi.
I have just set up a simple guest book. I have a memo field
where the user can type there comments (access database). The problem is
that if the user wants to type..say..three paragraphs they can, However
when the guest book is viewed, it appears as one block of text.
Does anyone know how i can utilize code (asp) to detect blank lines
and put an html <br> in it's place to make it display properely
when the book is viewed???
Thanks,
Andrew
|
|
 |