Mallika Iyer
Mallika Iyer

Reputation: 710

Adding CKEditor through javascript onclick event adds a CKEditor to the DOM but does not allow me to enter text into it. Why?

I'm adding a ckeditor to my form using the onclick functionality - i.e., when the user clicks a button, the ckeditor is added to the form. I'm echoing out the html generated when a ckeditor is added to a page through the javascript function.

The ckeditor is added, but the text area cannot be modified.

is it because i'm adding the html to generate the ckeditor as : ckeditor.innerHTML = '......';

is there another way to add a ckeditor to my form using the javascript onclick (like: onclick="addCKEditor();")

Thanks!

Upvotes: 0

Views: 1242

Answers (1)

Mallika Iyer
Mallika Iyer

Reputation: 710

using CKEDITOR.replace('id) after adding the textarea to the DOM - within the javascript function, got the job done.

Upvotes: 1

Related Questions