cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Is it possible to set a value for Multi Line Textbox with rich text enabled?

Jump to solution

Hello there,

I would like to know if it is possible to set a value for a Multi Line Textbox with rich text enabled in a Classic Form via JavaScript? I would like to be able to update the value of the field with html content depending on another field.

I tried already many different things but nothing worked so far and I am able to set the value for text fields and normal multi line text fields.

I tried things like this but without any luck: 

var txtArea = NWF$('#'+ remun).closest('tr').find('div[id$="_inplacerte"]');

txtArea.html("testing 123");

Reply
4 Replies
Workflow Hero

Re: Is it possible to set a value for a rich text field?

Jump to solution

I use this function to set mine. I add a form variable with a reference to this function. Use a unique class on the rich text field and pass that along with the text you'd like to the function.

function setMyRichTextField(FieldClass, RichText) {
    "use strict";
    NWF$("." + FieldClass).innerhtml(RichText);
}

Reply
Workflow Hero

Re: Is it possible to set a value for a rich text field?

Jump to solution

Hey Jeremiah thanks for your reply.

Here is what I did to reproduce your solution:

  • I inserted a Multi Line Textbox with enhanced rich text enabled
  • I inserted your function as Custom JavaScript under Form Settings
  • I called the function via Form variable like this: setMyRichTextField("MyField", "<p>Test</p>")

When I run it I get the error "Uncaught TypeError: NWF$(...).innerhtml is not a function" and if you search for that error they tell you that you should use" .innerhtml = RichText. This doesn't produce an error but is also not working.

Do you use a normal Rich Text field or a Multi Line Textbox in your solution? 

Thanks

Jan

0 Kudos
Reply
Workflow Hero

Re: Is it possible to set a value for Multi Line Textbox with rich text enabled?

Jump to solution

I am struggling with this. did you find any solution?

0 Kudos
Reply
Workflow Hero

Re: Is it possible to set a value for Multi Line Textbox with rich text enabled?

Jump to solution

Hey Shahad yes we figured it out! 

NWF$("#" + ClientIDJavaScriptVariable).siblings().contents().find('body').html(data);
0 Kudos
Reply