php - DB content not coming into tinyMCE textarea

448

My tinyMCE editor is showing up just fine, but in the form I have a select box and according to what you choose, the textarea is filled with content accordingly.

Like if I choose PHP, then the description for PHP comes into the textarea. It works without tinyMCE, but when I add tinyMCE, nothing shows up in the textarea.

34

Answer

Solution:

TinyMCE does not display the content of the textarea in real-time. It reads the content on start, and saves it at the end of the work. All the edit work takes place in aniframe element, created on the fly by Tiny. If you update thetextarea, you must ask TinyMCE to refresh itself.

In a few minutes I will look up the exact method for you. (It was long time ago when I was using TinyMCE, so I forgot the method names.)

[few minutes have passed..]

Look at the documentation: http://www.tinymce.com/wiki.php/How-to_load/save_with_Ajax_in_TinyMCE

You just need to call setContent method on the TinyMCE editor, instead of (or in addition to) setting the new text in thetextarea.

123

Answer

Solution:

with tiny mce sometimes it dependes the plugins that you in the Init. Try Removing all the plugins and add one by one and see if this helps you in finding a better solution for this.

Some plugins like the media can strip and not allow tags in the text area, so the textarea is empty if tiny mce doens't allow that tags, or add valid_elemens:'[]' and try if it shows something.

Good luck

People are also looking for solutions to the problem: Creating a restful API using PHP as server and jQuery as client

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.