Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CKeditor textarea值未通过POST发送_Post_Dynamic_Ckeditor - Fatal编程技术网

CKeditor textarea值未通过POST发送

CKeditor textarea值未通过POST发送,post,dynamic,ckeditor,Post,Dynamic,Ckeditor,我有一个表单,其中我使用jQuery的.remove()删除了一些CKeditor实例化的文本区域,并通过此函数添加了新的文本区域: 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

我有一个表单,其中我使用jQuery的
.remove()
删除了一些CKeditor实例化的文本区域,并通过此函数添加了新的文本区域:

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 );
}
但当我提交表单时,新添加的Ckeditor textarea发送空值

只有当我从表单中删除一个CKeditor textarea并在其后添加一个新的CKeditor textarea时,才会发生这种情况。如果我通过该函数添加任何textarea,只要我不删除任何现有的textarea,效果就很好。 顺便说一句,现有的表单是通过PHP循环从数据库中添加的,它实际上是一个编辑表单

有什么想法吗


谢谢。

似乎每当我必须对任何条目执行
.remove()
操作时,我都必须在删除HTML代码之前销毁CKeditor实例

因此,在删除CKeditor文本区域之前,应执行以下操作:

CKEDITOR.instances['textareaID'].destroy(true);
干杯