I have a text area that I want to pre-populate with some specific text that includes line breaks. I\'m populating the area onLoad but I can\'t get the line breaks to work c
i had tried many ways to break a textarea into an array. used this method, it might not be the best.
using .split('\n') does not remove the break and it will create whitespace or break when insert into database. therefore, i replace it with
textarea content:
12345
6789
a = a.replace(/\n|\r\n|\r/g, "
");
var stringArray = a.split('
');
for (var i = 0; i < stringArray.length; i++) {
var myString = stringArray[i];
myString = myString.replace('
', "");
response.write(myString);
}