displaying text on asp page from access

R

raj chahal

Hi there

I've created a db field with Memo type, and I have stored some text with
carriage returns (no html) So the 3 words start on a differnt line. In
access this displays correctly ( each word starts on a new line).
However when I display these on a web page all the words appear on the same
line.

I need the words to be displayed on a seperate line.

ANY HELP APPECIATED.

thanks
 
M

McKirahan

raj chahal said:
Hi there

I've created a db field with Memo type, and I have stored some text with
carriage returns (no html) So the 3 words start on a differnt line. In
access this displays correctly ( each word starts on a new line).
However when I display these on a web page all the words appear on the same
line.

I need the words to be displayed on a seperate line.

ANY HELP APPECIATED.

sText = {your text on multiple lines}

<%=Replace(sText,vbCrLf,"<br>")%>

or

<pre>
<%=sText%>
</pre>
 
R

raj chahal

Thanks for your help.

Can I also give the user to make a piece of text bold without a 'rich text
editor'. If not any recommendations?
Thanks in advance..
 
M

McKirahan

raj chahal said:
Thanks for your help.

Can I also give the user to make a piece of text bold without a 'rich text
editor'. If not any recommendations?
Thanks in advance..

[snip]

You'd have to know which word or words they want to be in bold.

One way is to have them start each line they want in bold with a period;
(or some other special character -- change the value of "cCHR" to it).

Then you could do this:

<%
Const cCHR = "."
sText = {your text on multiple lines}
aTemp = Split(sText,vbCrLf)
For iTemp = 0 To UBound(aTemp)
sTemp = aTemp(iTemp)
If Left(sTemp,1) = cCHR Then
aTemp(iTemp) = "<b>" & Mid(sTemp,2) & "</b>"
End If
Next
sText = Join(aTemp,"<br>")
%>

<%=sText%>

The above is untested -- let me know if there's a problem.
 

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

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top