I'm replacing a textarea with a ck editor but when it loads it doesn't work. It was working for me before but now it seems to not be working at all. The behavior I am seeing is that the textarea is replaced with the nice editor, but the surface of the editor is not clickable, doesn't cause the cursor to become a text pointer, and doesn't have a carrot. I cannot input any text. I don't know where to begin troubleshooting so I'll include my code below:
In the page:
In config.js:
In my js file:
The only other notable thing is that the textarea is added after the page loads using ajax and javascript, then I call the code above which adds the editor.
Any help would be greatly appreciated.
EDIT: New info: When the textarea is prepopulated with content, the content briefly appears then disappears.
EDIT2: It seems that the problem only occured when the CKEditor was created while hidden. I'd like to be able to add the content hidden, replace the textarea with the CKEditor, then show it, but for now it's working to create the editor while showing. If anyone knows how to make the CKEditor work when created while hidden, I'd greatly appreciate it.
In the page:
<textarea cols="20" id="Content" name="Content" rows="2"> </textarea>
In config.js:
CKEDITOR.editorConfig = function (config) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.toolbar = "Basic"; config.toolbarCanCollapse = false; config.resize_enabled = false; config.removeDialogTabs = 'link:target;link:advanced'; config.toolbar_Basic = [ ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'], ['Font', 'FontSize'] ]; };
In my js file:
if ($("#Content").length > 0) { CKEDITOR.replace("Content", { height: 296, width: 260 }); }
The only other notable thing is that the textarea is added after the page loads using ajax and javascript, then I call the code above which adds the editor.
Any help would be greatly appreciated.
EDIT: New info: When the textarea is prepopulated with content, the content briefly appears then disappears.
EDIT2: It seems that the problem only occured when the CKEditor was created while hidden. I'd like to be able to add the content hidden, replace the textarea with the CKEditor, then show it, but for now it's working to create the editor while showing. If anyone knows how to make the CKEditor work when created while hidden, I'd greatly appreciate it.