jQueryを使用してCKeditorでインスタンス化されたテキストエリアをいくつか削除.remove()
し、この関数を使用して新しいテキストエリアを追加するフォームがあります。
function addchapter() {
var randomnumber = Math.floor(Math.random()*9999);
var clone = $("#newchapter").clone(); //which is a hidden DIV containing the plain HTML to be added in form
$(clone).attr('id',randomnumber);
$("#chapters").prepend(clone);
var newrandom = Math.floor(Math.random()*9999);
$("#"+randomnumber+" textarea").attr('id',newrandom);
CKEDITOR.replace( newrandom );
}
これは機能しますが、フォームを送信すると、新しく追加されたCkeditortextareaは空の値を送信します。
これは、フォームから1つのCKeditorテキストエリアを削除し、その後に新しいテキストエリアを追加した場合にのみ発生します。関数を介してテキストエリアを追加すると、既存のテキストエリアを削除しない限り、うまく機能します。ところで、既存のものはPHPループを介してデータベースから追加されます。これは実際には編集フォームです。
何か案は ?
ありがとう。