ckeditor内容到textarea上change事件 - 初学者 [英] ckeditor content into textarea on change event - beginner

查看:1380
本文介绍了ckeditor内容到textarea上change事件 - 初学者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在用户将值输入ckeditor时将我的ckeditor的内容输入到相关的textarea中。

I am trying to get the contents of my ckeditor to be entered into the associated textarea as the user enters the value into the ckeditor.

我已阅读了几个有用的线程,即此处在这里,但我会绕过圈子,因为我的代码体验和知识不是那么伟大。

I have read several helpful threads, namely here and here, but I am going around in circles as my code experience and knowledge is not so great.

我理解ckeditor如何工作,我应该使用 post

I understand how the ckeditor works and that I should be using the change event as described in the post.

我已经设法添加了以下jquery代码当用户向ckeditor输入值时显示警告消息:

I have managed to add the following jquery code to display the alert message when the user enters value into the ckeditor:

    for (var i in CKEDITOR.instances) {
        CKEDITOR.instances[i].on('change', function() {alert('value changed!!')});
    }

我的文字区号是:

<textarea id="id_a_description" rows="10" cols="40" name="a_description" class="input-95pc" style="visibility: hidden; display: none;"></textarea>

如何更改上述jquery代码以从ckeditor输入文本区域作为用户使用ckeditor更改事件的类型?

这真的会帮助我,因为我非常失望,

This would really help me out as I am so frustrated at not being able to solve this even-though I think I am very close to the solution..

推荐答案

尝试在onchange事件中调用此函数

Try calling this function in the onchange event

CKEDITOR.instances[i].updateElement();

这篇关于ckeditor内容到textarea上change事件 - 初学者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆