# Update textarea (tinyMCE) using Ajax/RJS

**URL:** <https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869>\
**Category:** Rails\
**Created:** [March 25, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869 "2008-03-25T13:49:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [March 25, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869/1 "2008-03-25T13:49:00Z")

</div>

Hi -

I have a which I am allowing users to select text bodies  
which are automatically populating a textarea on the page - which they  
can then edit.

This is working fine. However… once I add my tinyMCE editor to the  
textarea it doesn’t work - it won’t update.

I am using the tinymce plug-in by Blake W…

I know tinymce initiates the textarea or filters its values through  
its initiation, but curious how to execute this when I do my page  
update via my rjs file.

Any help appreciated.

-Adam

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [May 23, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869/2 "2008-05-23T15:58:50Z")

</div>

northband wrote:

> Hi -
> 
> I have a which I am allowing users to select text bodies  
> which are automatically populating a textarea on the page - which they  
> can then edit.
> 
> This is working fine. However… once I add my tinyMCE editor to the  
> textarea it doesn’t work - it won’t update.
> 
> I am using the tinymce plug-in by Blake W…
> 
> I know tinymce initiates the textarea or filters its values through  
> its initiation, but curious how to execute this when I do my page  
> update via my rjs file.
> 
> Any help appreciated.
> 
> -Adam

try  
page.call ( ‘tinyMCE.setContent’, ‘your content here’)  
obviously if your content is a ruby variable, drop the quotes  
This has problems if you have multiple editors on a page.  
I also noticed that I had some trouble unless I used the html text\_area  
tag instead of the text\_area helper, but ymmv.

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [March 12, 2009, 7:00am UTC](https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869/3 "2009-03-12T07:00:01Z")

</div>

northband wrote:

> Hi -
> 
> I have a which I am allowing users to select text bodies  
> which are automatically populating a textarea on the page - which they  
> can then edit.
> 
> This is working fine. However… once I add my tinyMCE editor to the  
> textarea it doesn’t work - it won’t update.
> 
> I am using the tinymce plug-in by Blake W…
> 
> I know tinymce initiates the textarea or filters its values through  
> its initiation, but curious how to execute this when I do my page  
> update via my rjs file.
> 
> Any help appreciated.
> 
> -Adam  
> Hi Adam,

I have a smiliar problem how did you update the text area? I have an id  
associated with text area and on click of a tree element, I intend to  
update teh content of text area somehow the position:top position:bottom  
does not work.

Thanks,  
Sudhi

---

<div class="post-metadata">

**Author:** ![northband](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ecae2f/32.png) [@northband](https://www.ruby-forum.com/u/northband)\
**Post date:** [March 15, 2009, 2:10am UTC](https://www.ruby-forum.com/t/update-textarea-tinymce-using-ajax-rjs/132869/4 "2009-03-15T02:10:19Z")

</div>

Here’s an old (2006) of mine that has an example of getting TinyMCE’s  
javascript to work after some other javascript runs. Might be useful or  
it  
might be out of date.  
[http://blog.katipo.co.nz/?p=24](http://blog.katipo.co.nz/?p=24)

On Thu, Mar 12, 2009 at 7:00 PM, Sudhi K. \<
