How to Preserve Line breaks while copying and pasting the text from String field to HTML field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2019 10:27 AM
Hi All - I want to preserve the line breaks while copying and pasting the text from String field to HTML field. Below is the screen shot that I am facing trouble with. And I am using a UI Action for copying and pasting. Any help is really appreciated.
client.u_m1 = current.u_m
Thanks
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2019 12:46 PM
If your string is picking up on the newline characters in the top text box, you could try a string.replace(/\n/g, '<br></br>') to replace the javascript new lines with with HTML line breaks when it moves it to the lower text box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 09:34 AM
That works beautifully!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 09:44 AM
Since this worked, could you please mark it correct so that others might benefit from the answer?