+ Start a Discussion
stratus adminstratus admin 

S-Control, Javascript and carriage return

I have a JavaScript variable I'm setting to create a lead from a contact. Some of the fields contain carriage returns. As you can imagine, JavaScript does not like this.

This is my example variable:

lead.set("Description", "{!Contact.Description}");

How is the best way to clean up this variable so it doesn't show up with carriage retruns?

lead.set("Description", "This is my test example

test

test");




-Scott
Michael SnowMichael Snow
I ran into the same problem and ended up having to query for the field (e.g., "select description from Contact where ID = '{!Contact.Id}'").