I have a text input area that saves the text to a variable called MyNotes.
I have javascript on an email icon trigger that captures the MyNotes variable info and uses the user's email address to send the content to them in an email.
The problem is, I can't seem to keep line breaks from the text in MyNotes when the javascript puts the content into the body of the email.
Here is the code for the email function:
var player = GetPlayer();
var useremail=player.GetVar("Email");
var subject="Cognitive Bias";
var notes1=player.GetVar("MyNotes");
var content="Cognitive Bias%0d%0A%0d%0A";
content+=notes1;
var mailto=link='mailto:'+useremail+'?subject='+subject+'&body='+content;
win=window.open(mailto_link,'emailWin');
MyNotes is the variable the text input content is saved to.
I have tried appending
.replace(/\n/g, "\\par\n")
to various parts of the code to try to get the breaks to show up, but have had zero success.
The code was originally from an e-learning developer for adding note-taking capabilities to courseware.
I have little javascript experience personally.
Any assistance is appreciated.
Thank you!