CKEditor 对话框:按 ID 引用输入字段 [英] CKEditor dialogs: referencing input fields by ID
本文介绍了CKEditor 对话框:按 ID 引用输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CKEditor 对话框中的每个输入字段都用一个唯一的编号重命名,但编号会根据可见的选项而变化.
Each input field in the CKEditor dialogs are renamed with a unique number, but the number changes depending on what options are visible.
我需要引用 'txtUrl',它的 id 类似于 #35_textInput.
I need to reference 'txtUrl' which has an id something like #35_textInput.
到目前为止,我发现这样的事情应该可以工作:
So far I have discovered that something like this should work:
alert(CKEDITOR.instances.myElement.document.$.body.getId('txtUrl'));
但事实并非如此.请帮忙.
But it doesn't. Please help.
推荐答案
@Rio,您的解决方案非常接近!这是最终的解决方案:
@Rio, your solution was really close! This was the final solution:
var dialog = CKEDITOR.dialog.getCurrent();
dialog.setValueof('info','txtUrl',"http://google.com");
return false;
这篇关于CKEditor 对话框:按 ID 引用输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文