This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Description entered in the form (textarea) gets wrapped Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Description entered in the form (textarea) gets wrapped" Watch "Description entered in the form (textarea) gets wrapped" New topic
Author

Description entered in the form (textarea) gets wrapped

sachin pachpute
Ranch Hand

Joined: Aug 05, 2004
Posts: 35
In my spring, JSP based application, user is entering free from description in the text area. But when data is saved and displayed on the next (read only) page, entire text is wrapped in to single para. I want whole text to be saved as user enters it along with line spaces, newlines, tabs etc.

eg is as below.

below entered description when saved will get wrapped in to a single para and will not be dispayed as it looks below.I have posted this question on other forums and also tried finding solution online so please help.


Books in the stack are

Spring
Hibernate
jQuery
mySQL
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Either use a pre tag

Or you need to convert the new lines and extra spaces to <br/> and &nbsp;
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Description entered in the form (textarea) gets wrapped
 
Similar Threads
how to upload using html or javascript?
JSF multiple check box and single array list in backing bean
input data disappeared after the apply button is clicked
Data in an applet not being displayed after save
What do I have to use....