tinymceで複数のテキストエリアを追加する方法を教えてください..! 私はこの結果を気に入りたかった:
私のスクリプトの例はここにあります: http://tuto-rial.com/index2.txt

tinymceで複数のテキストエリアを追加する方法を教えてください..! 私はこの結果を気に入りたかった:
私のスクリプトの例はここにあります: http://tuto-rial.com/index2.txt

このためには、2つの別々のtinymceinit関数を使用する必要があります。最初のページには2つのテキストエリアがあると思います。最初のものは、次のようなinitを使用してページの読み込み時にアクティブ化されます。
$(document).ready(function() {
tinyMCE.init({
// General options
mode: "exact",
elements : "id_of_first_textarea",
...
});
});
[新規追加]-buttonclickで、次の操作を行います。
tinyMCE.init({
// General options
mode: "exact",
elements : "id_of_second_textarea",
// deactivates the editor body
setup : function(ed) {
ed.onInit.add(function(ed, evt) {
// you may also add a click handler here to disable the focus of the editor body
$(ed.getBody()).attr('contenteditable', false);
});
},
...
});
[コンテンツを取得]ボタンアクションは次のことを行います。
var content = tinymce.get('textarea_id_of_the_desired_editor').getContent();
サイトの例に従うことができます: http://www.tinymce.com/tryit/multiple_configs.php
2 番目のものを常に iframe に配置し、フォームの送信時に iframe と通信してコンテンツを取得することができますが、これはあまり洗練されていないソリューションです。