This week's book giveaway is in the General Computing forum.
We're giving away four copies of Raising Young Coders: A Parent’s Guide to Teaching Programming at Home and have Cassandra Chin on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

formatting text output from database

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
not sure if this is the right place to ask this question but it seems as good as any other.
I am trying to fromatt text output to html from a mysql data base - the input was with a textarea - would like to maintain the same fromat as the imputted text however not working for me. Anyone know where i could get some information on approaches to this problem
thnking you for you help
tom mcmorrow
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the mysql database retain the formatting?
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that you are not specifying the textarea quite right. By default, a textarea ignores end-of-lines. Try adding "wrap='hard'" to yor textarea tag.
 
tom mcmorrow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
thanks for your swift replies Cindy and Frank
i don't know much about this particular subject and was hoping maybe someone could point me in the direction of some material on it. My experience of working with databases is very limited.
tom
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I am back to my question.
Did you save the text in the TextArea or the object which is a TextArea or what?
Or are you really just worried about end-of lines ?
[ August 23, 2002: Message edited by: Cindy Glass ]
 
tom mcmorrow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks again cindy for you patient interest
My text is inputted to a textArea it is then submitted as part of a form to a servlet which saves the imput to a mysql database. The data is again retrieved on demand from the database by an servlet and outputted to a html page. I would like to maintain the output in the same format as
the text was imputted.
tom
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to explain what you mean by "in the same format". When text is input into a TextArea it is usually represented on the screen by some LayoutManager. Change the window size - the "format" changes to accomodate that.
What formatting is NOT being saved?
Do you really mean that you just want to insure that any New Line or Carriage Returns are preserved, like Frank thought?
Are you trying to retain the FONT of the input?
Is this really a JAVA or JSP TextArea, or are you talking about an HTML (JavaScript) TextArea?
[ August 23, 2002: Message edited by: Cindy Glass ]
 
tom mcmorrow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
primarly i am trying to retain the tab spaces at the beginning of the lines. Hence the first word stands out as it is not indented the other lines are. i have used a JText area for input. Franks idea works in part for me i will try a little more experiment on it and come back in a while
tom
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic