Welcome to WebmasterWorld Guest from 174.129.151.95

Forum Moderators: open

Message Too Old, No Replies

Line Breaks In TextArea

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

10+ Year Member



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]