Mauren
Mauren

Reputation: 1975

How to test whether CKEditor dialog has a component?

I have implemented a small Java servlet to upload some files using CKEditor's prebuilt dialogs, but I'm facing a small problem: I have multiple prebuilt dialogs and I'd like to fill in the URL fields of any of them when the upload has completed, but not all dialogs have the same ID for this field.

How could I test whether the field 'txtUrl', for example, is present in that dialog so that I can fill it? I have tried by using CKEDITOR.dialog.getCurrent().getElement(), but even when setValueOf fails it still returns valid DOM elements, so I'm running out of ideas to solve it.

Upvotes: 1

Views: 94

Answers (1)

oleq
oleq

Reputation: 15895

The following will return dialog field or undefined if not found:

CKEDITOR.dialog.getCurrent().getContentElement( 'info', 'someFieldName' );

Upvotes: 1

Related Questions