Hi all,
I'm a bit new to Javascript and am trying to create a delimited string from a textarea. The problem is when passing in the textarea, it adds newlines for each row on the textarea. I need to have the entire textarea parsed into a string with a delimiter for each line (replacing the newline char). So for example, if you passed in a textarea with the following lines (which is also how it looks when using the alert function):
abcd
efgh
ijkl
It would look like: abcd-efgh-ijkl
after parsing.
function submitToForm(form)
{
var param_textarea = form.listofplugins.value;
var test = param_textarea.replace(/\\r?\\n/, /:/)
alert(test);
}
Thanks a lot!