I am using the jQuery TinyMCE control in my .Net Web Forms application.
I primarily use it with AJAX and webservices however in one instance I have to let it post to the server as a part of the form.
For almost all input it works fine with
$('#<%= eText.ClientID %>').tinymce({
encoding: 'xml'
});
However the moment I try to save a single quote '
I get the unsafe input error.
What can I do to handle this?
Is TinyMCE free? Yes. The TinyMCE core editor is free to use for commercial and noncommercial purposes.
You can use TinyMCE without an API key. However there will be warning messages in the text editor area.
TinyMCE is an incredibly powerful, flexible and customizable rich text editor. This section will help you configure and extend your editor instance. Contribute to this page.
For those using version 4:
setup: function (editor) {
editor.on('SaveContent', function (ed) {
ed.content = ed.content.replace(/'/g, "&apos");
});
}
Oi, just when you give up and ask a SO question you find the answer on google. I'm probably going to need this later so I'm going to leave this here.
Thanks to OP on this blog. http://blog.tentaclesoftware.com/archive/2010/07/22/96.aspx#414
tinyMCE.init({
// ...
setup: function (ed) {
ed.onSaveContent.add(function (ed, o) {
o.content = o.content.replace(/'/g, "&apos");
});
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With