1

I'm using the HtmlBox 2.8 (http://remiya.com/cms/projects/jquery-plugins/htmlbox/)
Turns the textarea to a richtext editor.

when i change the value of the textarea, $('#Survey_Value').val(data.Value);
the text in the richeditor does not change.

how to change the text the text in the rich text editor?

CoffeeCode
  • 4,296
  • 9
  • 40
  • 55

1 Answers1

2

HtmlBox has a set_text(html) method you can call. Store the original htmlbox call you have now:

var box = $('#Survey_Value').htmlbox();

When you have new data call this:

box.set_text(data.Value);

This method accepts html and will set your <textarea>'s value as well.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
  • i tried it but it only addeds a new rich text editor(that has new value) in the existing rich editor – CoffeeCode Mar 11 '10 at 13:14
  • @CoffeeCode - Wasn't aware it wouldn't detect this, updated the answer, this approach should work, let me know if it gives other trouble. – Nick Craver Mar 11 '10 at 13:24