我无法将CK编辑器的更改值保存到数据库

时间:2019-01-17 07:23:35

标签: jsp

嗨,我在Jsp Page中包含了Ck编辑器。但是我在Ck编辑器中所做的任何更改都不会保存在数据库中。我正在使用标准Ck编辑器..
                    我尝试了下面的代码,但是我无法保存来自Ckeditor的数据

下面是我替换ckeditor的文本区域

        <form:textarea path="details" class="form-control" value=""
                                            rows="7" />

  **Required Js Files**      

                script src="<c:url value='/resources/ckeditor/ckeditor.js' />" /></script>  
                 <script src="<c:url value='/resources/ckeditor/adapters/jquery.js' />" /></script>  

这是我的脚本

                 <script >  
                     $(function(){  
                         $('#details').ckeditor();  
                     });  

在提交表格Im时,调用以下函数将Ckeditor值替换为textareaid,即详细信息...

            function dataready($data) {
                     var val= CKEDITOR.instances['details'].getData();

                     CKEDITOR.instances['details'].setData(val) 
                     } 
            </script>

    I have assigned the ckeditor value to the variable  val 
using .getData() and again I have assigned the value to details id using setData() ..

            After form submit I have to save the data entered in the Ckeditor to my databse

0 个答案:

没有答案