Enhanced Rich Text

rss

Posted by mcgaafar - Apr 13 ’16 at 09:42

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,

 

  • rostislav
    rostislav
    Moderator
    Member for: 8 years 22 days
    #1 by rostislav Apr 14 ’16 at 06:33

    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
    Member
    Member for: 7 years 4 months 12 days
    #2 by mcgaafar Apr 14 ’16 at 06:41

    Both scenarios are fine with me.

  • mcgaafar
    Member
    Member for: 7 years 4 months 12 days
    #3 by mcgaafar Apr 14 ’16 at 06:43

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

  • rostislav
    rostislav
    Moderator
    Member for: 8 years 22 days
    #4 by rostislav Apr 14 ’16 at 07:00

    [#3]:

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

    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;
    }); 
Displaying 1 to 4 of 4 messages