Welcome Guest, Not a member yet? Register   Sign In
tinymce + tabs = no correct form posting
#1

[eluser]nosonoso[/eluser]
I use tinymce in an ajax loaded tab based on JQUERY's tabs.
So if I click a link it opens a JQUERY tab with a form.
The form contains a working tinymce (So I can edit my text etc...)

In the header of home.php I include the tinymce code as usual.
Code:
<!-- start tinymce -->
  <scri+pt type="text/javascript" src="&lt;?= ASSETS ?&gt;js/tiny_mce/tiny_mce.js" >[removed]
  &lt;!-- end tinymce --&gt;

The view (loaded in the tab) contains the following code:
Code:
<scri+pt language="javascript" type="text/javascript">
tinyMCE.init({
            theme : "advanced",
            mode : "textareas",
        });
</scri+pt>

&lt;?= $my_form ?&gt;

No problem until I start posting the form.

If I don't use the tinyMCE everything goes the way it should: it posts to a controller and the controller takes care of the rest, writing it to a mysql-db-table.

When I post the form with the tinyMCE, it just posts the loaded content (not the changed text). So if I edit the text it just doesn't post any changes. If I keep my page open, close the (ajax) jQuery tab and re-open the tab with the tinyMCE, then try again changing some text, it posts the changes like it should...
So you have to post the form twice before it really posts the changes you've made...

Maybe some people have tackled this problem?

ps: in IE7 it never posts the changes made to the text - but hey, what's new ...
#2

[eluser]Mellkior[/eluser]
Try

Code:
<scri+pt language="javascript" type="text/javascript">
tinyMCE.init({
            theme : "advanced",
            mode : "textareas",

            onchange_callback: function(editor){
              tinyMCE.triggerSave();
            }

            });
</scri+pt>




Theme © iAndrew 2016 - Forum software by © MyBB