Enhanced Rich Text

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
mcgaafar
Posts: 44
Joined: Sun Jan 17, 2016

13 Apr 2016

Hi,

I have a form with the following fields:

Link: Hyperlink Field - (ex.: hyperlink: "http://www.plumsail.com" , description: Plumsail)

Description: Multiline plain text - (ex.: SharePoint Solutions)

Formatted Description: Enhance Rich Text



I would the user to only fill in the link and the description fields, and get the form to auto populate the enhanced rich text accordingly following the example like this: <h3><a href="http://www.plumsail.com" target="_blank">Plumsail</a></h3><h2><span class="ms-rteThemeForeColor-3-0">SharePoint Solutions</span></h2><br>

Appreciate if you can help me achieve this.

Thanks,

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

14 Apr 2016

Do you need to update the ERTF as soon as the user changes link or description or doing it before submitting is fine? My proposition would be to disable the ERTF field, and on submission enable it and fill it in.

mcgaafar
Posts: 44
Joined: Sun Jan 17, 2016

14 Apr 2016

Both scenarios are fine with me.

mcgaafar
Posts: 44
Joined: Sun Jan 17, 2016

14 Apr 2016

i only need to know how to do it, i struggled to get it work without any luck.

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

14 Apr 2016

Check internal names. You can also just hide the formatted description field with CSS ('display: none;')

Code: Select all

fd.field('FormattedDescription').readonly(true)
fd.onsubmit(function(){
	fd.field('FormattedDescription').readonly(false);
	fd.field('FormattedDescription').value('<h3><a href="'+fd.field('Link').value()[0]+'" target="_blank">'+fd.field('Link').value()[1]+'</a></h3><h2><span class="ms-rteThemeForeColor-3-0">'+fd.field('Description').value()+'</span></h2><br>');
	return true;
});

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests