This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Display textarea contents as it is in Browser?

 
kishore kadiri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic