CkEditor Doesn't post value

↘锁芯ラ 提交于 2019-12-05 20:00:54
Wick

On submit, run this code:

for (instance in CKEDITOR.instances) {
    CKEDITOR.instances[instance].updateElement();
}

.. basically for AJAX, you need to force CKEditor to update your textareas so they contain the data you see in the CKEditor windows. See this question for more details.

You don't really need to update anything with JS. All you have to do is to make sure your textarea (the one you replace with CKEDITOR.replace() on $(document).ready()) has the same name as the property you want to set value of, e.g.:

<textarea id="editor" name="Body">@Model?.Body</textarea>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!