Ok, having line breaks in a select single option is not a good practice, also because HTML doesn't support it: you can't see a line break in a SELECT element.
Having said that, if you really want to copy a text option that contains line breaks, there are at least two different cases:
- if the original content contains actual line breaks, everything should work without any change
- if the original content contains <br> tag instead of line breaks, you should first replace the <br> with line breaks, so instead of:
selectedindex = $('[name="Report_Template"]')[0].selectedIndex;
$('[name="Report"]')[0].value = $('[name="Report_Template"]')[0][selectedindex].text;
you should do something like:
selectedindex = $('[name="Report_Template"]')[0].selectedIndex;
var mytext = $('[name="Report_Template"]')[0][selectedindex].text;
var mytext_2 = mytext.replace(/<br>/gi, "\n");
$('[name="Report"]')[0].value = mytext_2;
As I said, having line breaks in a select option is however something I don't recommend.
Best,