javascriptjqueryckeditor

How to insert a specific text into CKEditor image/link dialog URL input field?


So, I use CKEditor 4 in my project, and I need to insert a string into the URL textfield in image or link dialog window (using js/jQuery) - i mean here:

explain image

I just can't figure out how to find some kind of identifier of this input element. I mean something like

var myText = 'abcdef...';
ckeditor.(that specific input field).val(myText);

Any ideas?


Solution

  • Try this:

    var newURL = 'http://stackoverflow.com';
    var dialog = CKEDITOR.dialog.getCurrent();
        dialog.setValueOf('info', 'txtUrl', newURL);