Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

teatarea in html

 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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

Balaji
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic