Display multiple lines

J

JStrauss

Hello,
Can anybody give me some tips on the best and/or easiest way to display
multiple lines in a field. The data is collected from a "textarea" field
when the form is submitted, and I want to display all of the data (multiple
lines) in a resulting HTML page. The data displays on a single line
(obviously) and does not wrap without manipulation of the string variable.
Is there an easier way to display the data?

Thanks,
Joe
 
D

dlbjr

Joe,

Here is a sample of html output.

<html>
<head>
<title></title>
</head>
<style>
..info
{
width: 150px;
}
</style>
<body>
<span class='info'>
This is where your text needs to go. Just set the width in the info class of
the style.
</span>
</body>
</html>


-dlbjr

Discerning resolutions for the alms
 
J

JStrauss

Thanks for the help. Unfortunately, the display is still on a single line. I
have included some snippets of the code:

<html>
<style>
..info
{
width: 300px;
}
</style><body bgcolor=#ffffff>
..
..
Work Requested / Problem Condition<br>
<span class='info'><%= strWorkReq %><br></span>
Services Performed<br>
<span class='info'><%= strServicePerf %><br>
</span>

Does this look correct?

Thanks for any help.

Joe
 
J

John

<%= Replace(strWorkReq,vbCrlf,"<br>") %><




JStrauss said:
Thanks for the help. Unfortunately, the display is still on a single line. I
have included some snippets of the code:

<html>
<style>
.info
{
width: 300px;
}
</style><body bgcolor=#ffffff>
.
.
Work Requested / Problem Condition<br>
<span class='info'><%= strWorkReq %><br></span>
Services Performed<br>
<span class='info'><%= strServicePerf %><br>
</span>

Does this look correct?

Thanks for any help.

Joe


class
 
A

Aaron [SQL Server MVP]

Then you're going to have to show us exactly what is going into the
database, so we know what characters are assumed to be carriage returns but
probably aren't.
 
L

Larry Bud

JStrauss said:
Hello,
Can anybody give me some tips on the best and/or easiest way to display
multiple lines in a field. The data is collected from a "textarea" field
when the form is submitted, and I want to display all of the data (multiple
lines) in a resulting HTML page. The data displays on a single line
(obviously) and does not wrap without manipulation of the string variable.
Is there an easier way to display the data?

It's not "obviously", because that's not the default behavior of HTML.
HTML always wraps, unless you specify otherwise. Is the data in a
table? If so, you probably have the "nowrap" flag turned on. If it's
not in a table, are you using the preformatted markup tag? Perhaps
you're using a style sheet which turns NOWRAP on for all table cells.
 
D

dlbjr

<html>
<style>
..info
{
width: 300px;
}
</style>
<body bgcolor=#ffffff>

Work Requested / Problem Condition
<br>
<span class='info'><%= strWorkReq %></span>
<br>
Services Performed
<br>
<span class='info'><%= strServicePerf %></span>
<br>


dlbjr
Pleading sagacious indoctrination!
 
J

JStrauss

Aaron,
Thanks for your comments. The data is collected in a ASP form "textarea"
field (with wrap=physical) and stored in a vbscript variable when the form
is submitted. The data is then displayed in an HTML form. There is no
database involved. When the data is input into the first form, the lines
wrap automatically in the textarea box. I have not seen any carriage return
or line feed characters in the text (but I may be missing them), and have
also tries several replace statements to change vbcrlf and &nbsp to html
acceptable characters. If I manually put a hard return in the data entry
form, the second form formats the display correctly, but that method is less
than friendly.

Here are a few snippets...
Data collection process:
<TABLE BORDER=0>
<tr><td>Work Requested / Problem Condition</td><td><TEXTAREA NAME="WorkReq"
COLS=40 ROWS=3 WRAP=Physical></TEXTAREA></td></tr>
<tr><td>Services Performed</td><td><TEXTAREA NAME="ServicePerf" COLS=40
ROWS=6 WRAP=Physical></TEXTAREA></td></tr>
</TABLE>

Data display process:
<html>
<style>
..info
{
width: 300px;
}
</style>
....
....
Work Requested / Problem Condition<br>
<span class='info'><%= Replace(strWorkReq,vbCrlf,"<br>") %></span>
<br>

Thanks for looking at this. I appreciate the help.

Joe
 
J

JStrauss

Aaron,
I looked at this article, even though I am not using a database with this
application. I have tried searching the string variable for occurrences of
chr(10), chr(13) and vbcrlf. I can't find any occurrence of any of these
characters in the string. My assumption is that the textarea input field is
not putting any of this characters in the string, so I might have to write a
small function to manually break the lines into some number of characters.

It shouldn't be this difficult.....

Thanks,
Joe
 
A

Aaron [SQL Server MVP]

Did you try using a table instead of a span?

I can't reproduce your problem, anyway. Maybe you could show us a URL where
this is happening. Maybe it's only happening in your own browser?

--
http://www.aspfaq.com/
(Reverse address to reply.)
 

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
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top