Save formatting in Text area box

D

Danny F

Is it possible to have line feeds/breaks automatically entered when the text wraps to a new line? I am using a <textarea> input on a form and using the <pre> tag when displaying the text to a html page (embedded in a .asp page). The text is being saved to a sql database. Returns seem to be displayed. But the wrapped text just displays as one long line.

Thanks for any help.
 
A

Aaron Bertrand - MVP

The wrapping is just in display... if you make your textarea wider, the wrap
will happen at a different spot. You can't determine where the wrap
happened once you've passed that data to the next page and to the database.
If you fix the width of the container that holds the displayed text,
wrapping will happen automatically (note that this won't necessarily be the
same as in the textarea, and most likely shouldn't be anyway).

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




Danny F said:
Is it possible to have line feeds/breaks automatically entered when the
text wraps to a new line? I am using a <textarea> input on a form and using
the <pre> tag when displaying the text to a html page (embedded in a .asp
page). The text is being saved to a sql database. Returns seem to be
displayed. But the wrapped text just displays as one long line.
 

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,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top