*
The moose likes Struts and the fly likes How to Display textarea contents as it is in Browser? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to Display textarea contents as it is in Browser?" Watch "How to Display textarea contents as it is in Browser?" New topic
Author

How to Display textarea contents as it is in Browser?

kishore kadiri
Greenhorn

Joined: Aug 31, 2004
Posts: 4
Hai,

My Form consists of one <textarea> field and that value should be displayed in the browser after submmiting.

Iam trying to display the contents of <textarea rows=7 cols=80></textarea> in the browser , The browser responds in a single line , i.e., It is printing the matter in single line after submitting the form.

Now What I wanted is , my <textarea> value contains number of paragraphs with different indendations. That same paragraphs and with same indentations should be displayed in the browser. Just like our JavaRanchs Adding New Topic <textarea>.

Can any one suggest me or direct me to resolve this problem.

Thanks for supporing,
Bye
Kishore Kadiri
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
You can perform String manipulation to
- replace new line characters "\r\n" with "<br/>"
- replace spaces with non-breaking spaces "&nbsp;"

There might be string manipulation utilities or tag libraries that do this.

Sheldon
[ September 03, 2004: Message edited by: Sheldon Fernandes ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Display textarea contents as it is in Browser?