Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKEditor not saving #149

Open
andresteves opened this issue Nov 10, 2017 · 2 comments
Open

CKEditor not saving #149

andresteves opened this issue Nov 10, 2017 · 2 comments

Comments

@andresteves
Copy link

Hi,

I am using CKEditor 4 and it is not saving any information I add into it.
Any ideas on why?

<form name="addfaq" action="" accept-charset="UTF-8" method="post" id="addfaq">
<textarea form="addfaq" id="addfaqtext" style="width:100%; max-width:100%;" rows=4 type="text" name="answer"></textarea>
<script> CKEDITOR.replace('addfaqtext'); $(function(){ $('form').sisyphus(); }); </script>

Thanks,
Andre

@simsalabim
Copy link
Owner

simsalabim commented Nov 11, 2017

I feel your frustration but I still think that one opened issue would suffice meaning there was no need to leave this comment on other discussions irrelevant to your problem.

As to the problem itself, I have no idea why the integration broke mainly because I'm not actively watching 3rd party releases, such as CKEditor. But I can give you a few hints, hopefully, it will point you in the right direction.

  1. WYSIWYG editors exist to decorate HTML form elements; what most of them do is hide the real HTML element and create a nicely looking "shadow copy". Think of a textarea element that is actually a div and renders bold and italic and does other fancy stuff. But what is submitted to the server must come from the HTML form. This means, there is a binding mechanism that keeps "what you see" (nicely looking div) in sync with "what you get" (the value of the underlying form element, textarea or an input).
  2. This plugin stores data that you put in form elements in browser's localStorage. It means it takes values of the actual HTML form elements and stores them elsewhere.

The above two points are intended to illustrate how the plugin is supposed to work with a decorated form. If the form is decorated, its real fields are hidden. When you change values of fancy looking components, a WYSIWYG editor synchronizes it with the underlying HTML elements; once that happens, this plugin takes the HTML elements values and saves them to localStorage. To make it all work you need to keep an eye on the WYSIWYG's markup.

My hunch is that the way CKEditor decorates elements changed, meaning markup is different now.

Hope it helps. As always, all contributions are welcome. If you solve this issue for yourself please share it with the others in the comments or pull requests. Thanks!

@simsalabim
Copy link
Owner

Here's an example of the plugin working with CKEditor v4.7.3. The official demo site features its work with CKEditor v4.1

I did not debug your code but if there are any adjustments you need to make, I'm sure they are minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants