Displaying text that contains carriage return/line feed

R

rjweytens

I have text that I want to display that was entered into a database
via a textarea element. I am using Struts and MySQL. I don't want to
use another textarea to display the text because the other data on the
form is displayed as plain text (no objects) and I don't want to mix
styles. Plus, the disable option on the textarea element sucks
because it won't display the scroll down bars and the text color is
too light (which I may be able to change with a style, didn't try
that).

Any suggestions?
 
C

Cid

I have text that I want to display that was entered into a database
via a textarea element. I am using Struts and MySQL. I don't want to
use another textarea to display the text because the other data on the
form is displayed as plain text (no objects) and I don't want to mix
styles. Plus, the disable option on the textarea element sucks
because it won't display the scroll down bars and the text color is
too light (which I may be able to change with a style, didn't try
that).

Try setEditable(false) on your text area.
 
C

Cid

Try setEditable(false) on your text area.

Oh wait, you're talking HTML here - sorry.

I've been in this same scenario, I just did a replaceAll on the text
string ("\\n","<br>" on the fly when writing the page. That what
you're after?
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top