Get Plain Text from Enhanced Rich Text Field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
satyrical
Posts: 2
Joined: Mon Nov 30, 2015

25 May 2016

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

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

25 May 2016

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests