This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes teatarea in html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "teatarea in html" Watch "teatarea in html" New topic
Author

teatarea in html

Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
<html>
<head>
<title>
</title>
</head>
<body>
<textarea rows=3 cols=100>\nthis is a test\nthis is a test
</textarea>
</body>
</html>

Now the test appears as "\nthis is a test\nthis is a test". I want the text to appear as

this is a test
this is a test.

Can anyone tell me how to handle this? This text comes from a program and hence I cant manually "enter" from my keyboard. But yes, I can do anything to programatically to achieve the same.

Thanks
Sripathi
Bajji Pat
Ranch Hand

Joined: Apr 05, 2005
Posts: 50
Hi

U can match the "\n" (newline) and replace them with <br/>

Balaji
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
it wont work. It will come as this is a test <br/>.I figured the solution for this. Use html entity. &#010; instead of \n.
I tried it and it works.

Cheers

[ May 06, 2005: Message edited by: Sripathi Krishnamurthy ]

[ May 06, 2005: Message edited by: Sripathi Krishnamurthy ]
[ May 06, 2005: Message edited by: Sripathi Krishnamurthy ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: teatarea in html
 
Similar Threads
TextArea in IE and NS -the no. of characters accepted per line differs
Releasing HTTP session state
how to check which key is pressed
editing xml file with jsp webapp
textarea empty tag