homepage Welcome to WebmasterWorld Guest from 23.22.217.122
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Line Breaks In TextArea
BlackRaven




msg:3350901
 12:12 am on May 27, 2007 (gmt 0)

I am trying to dynamically show the user textarea input through javascript in a preview panel, however my function only removes one instance of the '\n' and replaces it with '<br>'. I need to remove all instances of the '/n' chars.

var text=comments.value;
textarea=text.replace('\n', '<br/>');

[edited by: BlackRaven at 12:20 am (utc) on May 27, 2007]

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved