April 9th, 2002, 02:21 PM
-
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") %> <%= new java.util.Date() %> </textarea>
April 9th, 2002, 02:55 PM
-
something like /n or /r (I'm not sure?)
April 10th, 2002, 06:48 AM
-
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'
April 10th, 2002, 07:52 AM
-
Thanks
Thanks for all the assistance. It seems fine now.
April 21st, 2002, 11:24 AM
-
u can concatanate an "\n" character in btn the strings...