CKEditor的+ Yii的加载与AJAX:$ _ POST不包含更新后的值 [英] CKEditor + Yii loaded with AJAX : $_POST doesn't contain the updated value
问题描述
在短期:
-
我使用Yii框架
i'm using Yii Framework
我有一个CKEDITOR窗口在我的网页(PHP / Yii框架 - 正常工作)
i have a one Ckeditor window on my page ( php/ yii framework - works fine)
当我按下按钮,正在生成,并通过AJAX调用显示一个新的CKEDITOR窗口
when i hit a button, a new CKeditor window is being generated and shown through AJAX call
问题是:这个新的CKEditor窗口中正确显示存储在数据库中的文本,但:当我点击保存(与表单的其他部分一起产生一个Ajax按钮),从这个新CKEDITOR窗口中的值会不保存:CKEDITOR发回了它从数据库中得到了旧值
THE PROBLEM: this new CKEditor window correctly displays the text stored in the database BUT : when i hit "Save" (an ajax button generated together with the rest of the form) the values from this new CKeditor window will not save : CKeditor sends back the old values that it got from the database.
当我删除CKEDITOR离开平原< textarea的>
:一切都很好,所以我知道,控制器是好的。
When i remove the Ckeditor and leave the plain <textarea>
: everything is ok so i know that the controller is fine.
请,任何人都经历过这样的事?
Please, anybody went through something like this?
推荐答案
听起来像是一个典型的后AJAX JS的结合问题。 :)有几种可能性如何解决它,这取决于什么错误。
Sounds like a typical post-AJAX JS binding issue. :) There are a few possibilities for how to fix it, depending on what is going wrong.
这个帖子在Yii的论坛应该是你的钱,这就是我得到了大部分的这些建议: 的http://www.yiiframework.com/forum/index.php?/topic/9341-ckeditor-widget-in-a-cactiveform/
This post in the Yii forum should be money for you, it's where I got most of these suggestions: http://www.yiiframework.com/forum/index.php?/topic/9341-ckeditor-widget-in-a-cactiveform/
- 使用一个部件化的Yii扩展,它已经解决了这个问题( NHCKEditor?)
- 添加一个onClick回调的提交按钮,保存CKEditor的内容到隐藏的
'文本区域'('的onclick =&GT;'CKEDITOR.instances.TEXTAREA_ID.updateElement()',
- <一个href="http://stackoverflow.com/questions/924145/using-jquery-to-grab-the-content-from-ckeditors-iframe">Use jQuery的获取从CKEditor的的iFrame 中的数据使用...哪里。 AJAX验证等。
- Use a widgetized Yii extension which has already solved this problem (NHCKEditor?)
- Add an onClick callback to the submit button which saves the CKEditor content to the hidden
'textarea' ('onclick'=>'CKEDITOR.instances.TEXTAREA_ID.updateElement()',
- Use jQuery to get the data from the CKEditor iFrame to use... wherever. AJAX validation, etc.
祝你好运!
这篇关于CKEditor的+ Yii的加载与AJAX:$ _ POST不包含更新后的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!