Set a rich text field on load

rss

Posted by Sebastian Haugland - Sep 23 ’15 at 12:38

Hi

I think you have replied to this before but I cant find it...

I have a rich text field called "Description" and want to add a new line with the date automatically when the user hits a button - so that he can add text to the field fafter the date. As far as I remember you can't do this and a workaround was to add the line on load / before the form becomes visible.

How do you do that? either from a button or from "form load"

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 10 months 19 days
    #1 by rostislav Sep 23 ’15 at 05:02

    Just add the following code to the onclick handler for the button in Forms Designer:

    fd.field('Description').control()._el()
      .find('.ms-rtelong').contents()
      .find('body').html('<p>your date value goes here</p>');
    
  • Sebastian Haugland
    Sebastian Haugland
    Member
    Member for: 8 years
    #2 by Sebastian Haugland Sep 23 ’15 at 05:09

    Thanks smile don't know why I thought I had to write before form load...

Displaying 1 to 2 of 2 messages