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.

Filter by
Sorted by
Tagged with
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 ...
Iain Simpson's user avatar
  • 8,051
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-...
Pekka's user avatar
  • 445k
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 ...
HenryW's user avatar
  • 3,661
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. ...
Lukas Gund's user avatar
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 ...
Editorman's user avatar
  • 319
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 ...
manannan's user avatar
  • 410
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 ...
jackboberg's user avatar
  • 1,046
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)
Don Jones's user avatar
  • 9,367
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="...
fabien7474's user avatar
  • 16.4k
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 ...
Max's user avatar
  • 5,023
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)
Wiktor Walc's user avatar
  • 5,400
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 ...
miCRoSCoPiC_eaRthLinG's user avatar
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);...
dcp3450's user avatar
  • 11k
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 ...
tiantang's user avatar
  • 406
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 ...
claya's user avatar
  • 1,960
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?
AnApprentice's user avatar
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. ...
heldopslippers's user avatar
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&...
BrooklynDev's user avatar
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" ...
PHP CODER's user avatar
  • 1,563
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 ...
orbitory's user avatar
  • 1,120
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 ...
Alex's user avatar
  • 153
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['...
Petr Dušek's user avatar
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 ...
Nathan Osman's user avatar
48 votes
10 answers
70k views

CKEditor unwanted &nbsp; characters

How can I disable CKEditor to get me every time &nbsp;, when i don't want them? I'm using CKEditor with jQuery adapter. I don't want to have any &nbsp; tags.
V.Rashkov's user avatar
  • 1,601
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....
BlackBelt2025's user avatar
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 ...
Pekka's user avatar
  • 445k
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. ...
Per Henrik Lausten's user avatar
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 ...
Kosi2801's user avatar
  • 22.5k
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?
pegasus's user avatar
  • 953
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 ...
Didju Juzphart 's user avatar
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 ...
Gazillion's user avatar
  • 4,822
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', { ...
AnApprentice's user avatar
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 ...
air's user avatar
  • 6,204
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.
Upperstage's user avatar
  • 3,747
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 ...
Elitmiar's user avatar
  • 35.7k
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 ...
dwalldorf's user avatar
  • 1,379
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/...
davehauser's user avatar
  • 5,874
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....
Nic Hubbard's user avatar
  • 41.9k
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 ...
giammin's user avatar
  • 18.8k
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()...
sslepian's user avatar
  • 1,891
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 ...
Elitmiar's user avatar
  • 35.7k
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 ...
Shane Reustle's user avatar
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,...
kenpeter's user avatar
  • 7,706
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 ...
nivcaner's user avatar
  • 1,194
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....
feder's user avatar
  • 1,785
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 ...
B Z's user avatar
  • 9,362
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?
user3691644's user avatar
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 "...
lisak's user avatar
  • 21.7k
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 ...
hpique's user avatar
  • 120k
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>&#x9; That means the editor converts this: <p>paragraph 1</p> <p>...
dove's user avatar
  • 20.5k

1
2 3 4 5
16