You need to sign in to do that
Don't have an account?

carriage returns cause javascript error on render
Hi,
I have an S-Control that is calling a description field into a textarea.
When this description field has a carriage return, it causes a Javascript error
S-Control Code:
Code:
Rendered as:
Code:output += "<input>{!Opportunity.Description}</input>";
Rendered as:
output += "<input>this is line 1 this is line 2</input>";
What is the suggested way around this?
TIA
Something like:
<textarea id="id1">
{!Opportunity.Description}
</textarea>
Then in your javascript you can get the text as:
output += document.getElementById("id1").value;
HTHs,