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'));
但它不是。请帮助。
推荐答案
@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;
快乐的日子!感谢您的帮助,
Happy days! Thanks for your help,
R
这篇关于CKEditor对话框:通过ID引用输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文