1

I have a SharePoint multilines of text field, where I add line breaks (Enter), when I render the value using REST and add it to an html element, it's not rendered with the line breaks, although I am using $("#idOfField").html(multinesText);

where multilinesText is the value returned by my field.

It looks like this in browser console:

this requirement is as follows: ↵↵1- documenA ↵2- documentB

Any idea?

1
  • 2
    what is the actual value of multinesText coming from REST api response, you might have to replace "\n" with </br> in multinesText variable.. Dec 8, 2016 at 19:31

1 Answer 1

0

You can store the data response into temp object and then do then do the string replacement. See the multiline function described in the StackOverFlow post.

https://stackoverflow.com/questions/4535888/jquery-text-and-newlines

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.