When you type in a return (hit the enter key) in a textarea field, it puts
in an unseen character called carriage-return, line-feed. Its human-readable
form is &vbcrf;
When you display text in HTML (such as when you pull it from the database
for display) you need to take the value in that field and do an ASP replace
function, replacing the vbcrlf; with <BR>, which is what your browser
understands.
In ASP, the replace function works like this:
Replace(value you're working with, "the thing to be replaced", "the thing
you're replacing it with")
So if you pulled something from the database and put it into a variable
called strNews, then your code would be
strNews = Replace(strNews,"vbcrlf;","<br>")
The last two have to be in quotes.
"_Mike" <webforumsuser (AT) macromedia (DOT) com> wrote
Quote:
I'm not getting line breaks from my SQL table when I add dynamic text to
page.
Input into SQL database like this:
test
test
test
But I get this on my dynamic text page:
test test test
I'm using .asp and SQL. text datatype
Any advice? |