Thread: New Line!!

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    2
    Rep Power
    0

    New Line!!


    I am trying to pull a value (mediumtext) from the database and allow it to be edited. So far so good. I want to time and date stamp it. I am not having a lot of luck. The code below works, the values are retrieved and editable but I want to put in a line break (<P> or <BR>) between the <%= rs.getString("h_detail") %> and the <%= new java.util.Date() %>. Any clues? I am banging my head on the screen here !!!

    <textarea NAME="h_detail" ROWS="5" COLS="80" WRAP="VIRTUAL"><%= rs.getString("h_detail") %>&nbsp;<%= new java.util.Date() %>&nbsp;&nbsp;</textarea>
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
  4. #3
  5. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    Almost...it's \n or \r. They do seperate functions, but amount to almost the same thing (UNIX reads them differently to windows - you'll see the control-M char if you transfer these to UNIX without converting - not that java cares, it'll ignore these) . All you need to know is that the HTML will look at them the same, so use both.

    The <P> and <BR> won't work as they are inside the textarea. I don't do JSP(Sevlets instead), but I'd have thought that as with the HTML, if you put your tag on the next line then it'll format it to be on the next line.

    An aside:
    You can also declare them as a char which is quite odd but useful for String.indexOf() for example
    i.e. char a ='\n'
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    2
    Rep Power
    0

    Thanks


    Thanks for all the assistance. It seems fine now.
  8. #5
  9. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    India
    Posts
    7
    Rep Power
    0
    u can concatanate an "\n" character in btn the strings...

IMN logo majestic logo threadwatch logo seochat tools logo