Results 1 to 2 of 2
  1. #1
    anthrax is offline Member
    Join Date
    Feb 2009
    Posts
    57
    Rep Power
    0

    Unhappy html <textarea> problem

    <textarea wrap="virtual" name="activity_description" rows="7" cols="70"></textarea>

    for example I entered this message in my text area:

    "The quick.

    Brown fox.
    jump"

    then i saved it to my database.. when i query and display it back the result would look like this:

    "The quick. Brown fox. jump"

    it doesn't retain the way the user entered the message, how do i fix this?
    my PostgreSQL db column is set to recieve "character varying" and i do "INSERT INTO activity_info (activity_description)
    VALUES (?);
    stmt.setString(1, bean.getActivity_description());

    i'm using java program so this problem is related to java :) and i think it's how my java program handles the message that needs to be fixed.
    Last edited by anthrax; 01-17-2010 at 03:03 PM.

  2. #2
    jogep is offline Member
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    43
    Rep Power
    0

    Default

    The text in your textarea are plain text and no html, so you must convert linebreaks.

    As example :
    "\n" -> "<br/>"

    Bye

    Johannes

Similar Threads

  1. Problem in reading HTML input field while uploading file
    By sudipanand in forum Java Servlet
    Replies: 1
    Last Post: 11-27-2008, 10:26 AM
  2. How can I include a html file in html textarea?
    By surya_dks in forum New To Java
    Replies: 2
    Last Post: 10-04-2008, 08:20 AM
  3. Problem with applying Sql order by to html table
    By sireesha264 in forum Advanced Java
    Replies: 2
    Last Post: 02-04-2008, 11:20 AM
  4. TextArea additable and uneditable (copy/past problem)
    By qwerty55 in forum Advanced Java
    Replies: 0
    Last Post: 01-20-2008, 12:41 AM
  5. Problem with '/' character in HTML and JSP
    By Marcus in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-04-2007, 06:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •