Welcome to WebmasterWorld Guest from 54.167.29.212

Forum Moderators: open

Message Too Old, No Replies

Line Breaks In TextArea

     

BlackRaven

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]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month