Let us see how javascript, php, and ruby display the content of textarea with line breaks
Javascript:
document.getElemnetById(‘textareacontent’).value.replace(/\n/g,’<br>’);
PHP:
preg_replace(“/\n/”,”<br>”,$_REQUEST['t1']);
Ruby:
(teaxtareacontent).gsub(/\n/,”<br>”)

Hey,
Very informative. Keep sharing ur knowledge
Comment by Sri — February 1, 2008 @ 6:56 am
Yes, See the implementation here.
http://www.bumpedinto.com/goal/bintos/365
Comment by Sanjay — February 1, 2008 @ 7:04 am