Questions tagged [ckeditor]
CKEditor is an ecosystem of Open Source rich text editors with support for real-time collaboration. Use this tag together with the [ckeditor4] and [ckeditor5] tags to indicate the editor version.
796
questions
148
votes
13
answers
144k
views
CKEditor automatically strips classes from div
I am using CKEditor as a back end editor on my website. It is driving me round the bend though as it seems to want to change the code to how it sees fit whenever I press the source button. For example ...
37
votes
3
answers
25k
views
Get computed font size for DOM element in JS
Is it possible to detect the computed font-size of a DOM element, taking into consideration generic settings made elsewhere (In the body tag for example), inherited values, and so on?
A framework-...
50
votes
7
answers
54k
views
CKEditor strips <i> Tag
I'm trying to find a solution to avoid CKEditor, but also the older FCKeditor strips out any
<i> tag from previously inserted content to the db.
Case:
I insert html content to the db, some ...
28
votes
6
answers
108k
views
How to enable image upload support in CKEditor 5?
I will use the ckeditor v5 into my project. I´ve trying to use the image plugin, but I don´t find enough informations about it.
If you see the Demoe here, you easily upload images with Drag&Drop. ...
23
votes
4
answers
81k
views
Change form values after submit button pressed
[EDIT] After a lot of digging around, I found out that the problem was in how I integrated the CKEditor into my page. The simple and obvious way does work in this case, as laid out in the accepted ...
18
votes
2
answers
29k
views
Set cursor to specific position in CKEditor
Is there a way to set the cursor position to a known index inside CKEditor?
I want to do this because when I change the html inside the editor it resets the cursor to the start of the inserted ...
99
votes
32
answers
143k
views
CKEditor instance already exists
I am using jquery dialogs to present forms (fetched via AJAX). On some forms I am using a CKEditor for the textareas. The editor displays fine on the first load.
When the user cancels the dialog, I ...
114
votes
8
answers
144k
views
How can you integrate a custom file browser/uploader with CKEditor?
The official documentation is less than clear - what's the correct way to integrate a custom file browser/uploader with CKEditor? (v3 - not FCKEditor)
51
votes
6
answers
73k
views
How to ajax-submit a form textarea input from CKEditor?
I am using CKEditor, jQuery and jQuery form plugin and I would like to submit contents of the CkEditor form via an Ajax query. Here is my code:
<form id="article-form" name="article-form" method="...
26
votes
17
answers
49k
views
How to use CKEditor in a Bootstrap Modal?
If I use the CKEditor plugin in an HTML page based on a Bootstrap template, it works great, however if I insert the editor on a Bootstrap Modal like this
<!-- Modal -->
<div class="modal ...
105
votes
31
answers
132k
views
How to set the height of CKEditor 5 (Classic Editor)
In CKEditor 4 to change the editor height there was a configuration option: config.height.
How do I change the height of CKEditor 5? (the Classic Editor)
27
votes
11
answers
45k
views
Using jQuery to grab the content from CKEditor's iframe
I have a custom-written CMS that uses CKEditor *(FCKEditor v3) for editing content. I'm also using the jQuery Validation plugin to check all fields for error prior to AJAX-based submission. I'm using ...
74
votes
10
answers
155k
views
How do I set a value in CKEditor with Javascript?
I am wondering how I can set a value in CKEditor using Javascript?
I have tried the following, but neither of them work...
document.[form name].[textarea name].value=data;
$('#textareaID').val(data);...
25
votes
5
answers
34k
views
CKEditor strips inline attributes
I have been using CKEditor for some time and it has worked great. I've pretty much gotten rid of any problems that ive had but this one i cant seem to figure out. When i add inline attributes to ...
4
votes
1
answer
5k
views
How do I customize a ckeditor 4.2 builtin plugin like links?
If I want to add a tab to the links plugin, what's the best practice approach? I don't want to alter the release code just override it with a version with my customizations. So it's easy to update ...
74
votes
10
answers
133k
views
How to add a custom button to the toolbar that calls a JavaScript function?
I'd like to add a button to the toolbar that calls a JavaScript function like Tada()?
Any ideas on how to add this?
42
votes
11
answers
85k
views
Ckeditor update textarea
I am trying to get the ckeditor working. Obviously it doesn't make use of the textarea so on submit the form doesn't submit the text in the editor. Beceause I make use of polymorphic associations etc. ...
21
votes
9
answers
25k
views
How to set cursor position to end of text in CKEditor?
Is there a way to set the cursor to be at the end of the contents of a CKEditor?
This developer asked too, but received no answers:
http://cksource.com/forums/viewtopic.php?f=11&t=19877&...
18
votes
12
answers
56k
views
Jquery validation not working with ckeditor
I am using jQuery to validate forms.. but when I use CKeditor and try to validate it using jQuery, it's not working.
Here is the snippet of HTML code
<form class="form-horizontal" role="form" ...
17
votes
2
answers
16k
views
How do I programmatically set default table properties for CKEditor?
I am trying to set up the default properties of table that is created inside CKEditor.
For example is there a way to make sure that the attribute border is 0 not 1, or the width is by default set to ...
15
votes
5
answers
21k
views
Getting selected text with CKEditor Plugin on IE
I have made a plugin for CKEditor, but it relies on the currently selected text.
In FF and Chrome I can use:
var selectedText = editor.getSelection().getNative();
but this doesn't work in IE and ...
7
votes
1
answer
12k
views
CKEDITOR - how to add permanent onclick event?
I am looking for a way to make the CKEDITOR wysiwyg content interactive. This means for example adding some onclick events to the specific elements. I can do something like this:
CKEDITOR.instances['...
53
votes
7
answers
78k
views
How to configure ckeditor to not wrap content in <p> block?
I am using ckeditor on my website to make it easier for users to input HTML.
However, the data I get back from ckeditor is wrapped in <p></p> blocks. (Which I don't want.)
Is there some ...
48
votes
10
answers
70k
views
CKEditor unwanted characters
How can I disable CKEditor to get me every time , when i don't want them? I'm using CKEditor with jQuery adapter.
I don't want to have any tags.
16
votes
4
answers
16k
views
CKEditor 5 – get editor instances
I am migrating from CKEditor 4.7 to 5.
In CKE4, I would do something like this:
CKEDITOR.replace('text_area');
and then in another JS function I could get the data by
CKEDITOR.instances.text_area....
13
votes
7
answers
24k
views
CKEditor: Class or ID for editor body
I have an instance of CKEditor on a page. I am trying to give the CKEditor's body a class or ID so it matches some styles I have defined in a stylesheet.
There is a API documentation that should give ...
7
votes
3
answers
4k
views
Copying rich text and images from one document to MIME in another document
I have a solution for copying rich text content from one document to MIME in another document. See http://per.lausten.dk/blog/2012/12/xpages-dynamically-updating-rich-text-content-in-a-ckeditor.html. ...
73
votes
13
answers
124k
views
Turn off enclosing <p> tags in CKEditor 3.0
Is there a possibility to turn off the automatic enclosing of all written content within <p></p> in CKEditor 3.x?
I tried
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
but this just ...
58
votes
15
answers
150k
views
How can I get the content of CKEditor using JQuery?
I'm using CKEditor. I am saving the form values with ajax using page methods.
But the content of CKEditor value cannot be saving into the table.
I dont postback the page.
What can I do for that?
50
votes
8
answers
150k
views
Getting the textarea value of a ckeditor textarea with javascript
I'm a learner as far as JS goes and although I've spent a good few hours reading through tutorials which has helped lots but I'm still having problems figuring out exactly how I find out what a user ...
41
votes
14
answers
77k
views
Detecting onChange events from a CKEditor using Jquery
I'm working with the CKEditor and jQuery and I'd like to toggle a flag to true whenever a user changes the value of a field. One of those fields is a CKEditor instance.
All the textareas that have ...
37
votes
12
answers
198k
views
CKEditor, Image Upload (filebrowserUploadUrl)
I'm using CKEditor and would like to be able to allow users to upload and embed images in the Text Editor...
The following JS is what loads the CKEditor:
CKEDITOR.replace('meeting_notes', {
...
22
votes
6
answers
39k
views
ckeditor removing empty span automatically
i am using ckeditor and i have vary strange issue.
it remove automatically empty <span> for example
<span class="new-class"></span>
removed automatically.
i am searching for ...
21
votes
12
answers
25k
views
How to disable CKEditor context menu?
Does anybody know how to disable CKEditor's context (right click) menu? I would expect a configuration option, but I can't find one. I am using v3.1. Thanks.
19
votes
6
answers
74k
views
Adding custom styles to CKEditor
I recently added CKEditor to my app and I would like to include my own CSS stylesheets within the editor so that I can select them within the editor.
How do I accomplish this? My code so far looks ...
12
votes
3
answers
22k
views
Force CKEditor to add a class to p-tags
I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribute to text that is marked as ...
12
votes
4
answers
18k
views
CKEditor: Customized HTML on inserting an image
I'm using CKEditor 3.5 to provide WYSYWYG editing in a website. When inserting an image you can provide width and height of the image, which results in HTML like follows:
<img alt="" src="/Images/...
2
votes
3
answers
11k
views
Use Javascript variable in object name? [duplicate]
I am using CKEditor, and, when referring to the CKEditor instance, I need to use a variable. But, since calling the instance is a object, I am really not sure how to do this.
I am using:
CKEDITOR....
38
votes
11
answers
34k
views
Force CKEDITOR to refresh config
I created a cms application that use CKEDITOR and when I add some functionality to CKEDITOR I need to refresh some CKEDITOR .js /.css file.
But CKEDITOR force the browser to cache them.
I see that ...
36
votes
12
answers
69k
views
Get formatted HTML from CKEditor
I'm using CKEditor in my web app, and I'm at a loss as to how to get the contents of the editor with HTML formatting.
var objEditor = CKEDITOR.instances["sectionTextArea"];
var q = objEditor.getData()...
36
votes
7
answers
89k
views
How to add data to CKEditor using JQuery
Everytime a page loads I need to load text into the CK Editor using JQuery, in order to get data from CK Editor I use
var editor_data = CKEDITOR.instances['editor1'].getData();
now is there a ...
32
votes
7
answers
65k
views
How to properly destroy CKEditor instance?
I am running CKeditor 3.4 on a pretty simple page. I am having a problem (sometimes) where when I call document.main_form.submit(), it will not send along the contents of the textarea. After some ...
27
votes
6
answers
49k
views
How to define allowed tags in CKEditor?
Sometimes users copy and paste text from different sources to CKEditor, but I want to restrict what tags they can copy to CKEditor.
I only need to use certain tags in CKEditor: The list tag, break tag,...
22
votes
1
answer
29k
views
adding @font-face to CKEditor
I would like to add a font to the CKEditor font combo box. This in itself is easy enough. However the font I would like to add is a custom font that I use with the @font-face CSS3 attribute.
I managed ...
21
votes
3
answers
28k
views
How to retrieve the CKEDITOR.status "ready"?
In my script, I wanted to wait for the CKEDITOR to be in state ready before I let my own instructions go their way. So I consulted the CKEDITOR API and wrote the following condition:
if(CKEDITOR....
20
votes
7
answers
10k
views
CKEditor and ASP.Net MVC 3 RequiredAttribute
I've integrated CKEditor 3 (formerly FCKEditor) into my asp.net MVC (v3 to be specific) application. I have a RequiredAttribute in my model for the field that needs the editor but the client side ...
18
votes
3
answers
21k
views
How to get data from CKEditor 5 instance
I know that for CKEditor 4, you can get the textarea data like this:
var content = CKEDITOR.instances['comment'].getData();
How is this done for CKEditor 5?
17
votes
2
answers
32k
views
How to listen to basic events in CKEditor?
I can't figure out how to listen to focus, click, onKeyUp and other basic dom events in ckeditor. In the events summary there is only a few events regarding the lifecycle of ckeditor. And the "...
15
votes
10
answers
30k
views
Change CKEditor toolbar dynamically
How do you change the CKEditor toolbar dynamically (without using a pre-defined toolbar)?
The CKEditor Developer's Guide only tells you how to set the toolbar during initialization.
I'm using ...
15
votes
5
answers
22k
views
Removing unwanted newline characters when adding <p> in CKEditor
When loading content with a set of paragraphs in CKEditor, it replaces my <p> tags with <p>	
That means the editor converts this:
<p>paragraph 1</p>
<p>...