Page 1 of 1

Get Plain Text from Enhanced Rich Text Field

Posted: 25 May 2016
by satyrical
Hi !

Apologies if this has been answered before.

I am attempting to get the plain text from an enhanced rich text field.

Using the fd.field('ERT').value() I can get the field including html formatting as plain text, but is there a way to retrieve just the plain text value of the field ?

For example if the enhanced rich text field stores : <p>something</p>

then I need to set my plain text field to be : something


Thanks in advance for any pointers !

Cheers,


Benjamin

Re: Get Plain Text from Enhanced Rich Text Field

Posted: 25 May 2016
by rostislav
Hi,

You can use:

Code: Select all

 fd.field('...').control()._el().find('div.ms-rtestate-write').text()
But this won't get you a rendering of the html with spacebreaks, etc - just extracted text.