Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

teatarea in html

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
We don't have time for this. We've gotta save the moon! Or check this out:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic