CodeIgniter Forums
ckeditor causes "Disallowed Key Characters" error. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: ckeditor causes "Disallowed Key Characters" error. (/showthread.php?tid=44013)



ckeditor causes "Disallowed Key Characters" error. - El Forum - 07-30-2011

[eluser]tomyt[/eluser]
Hi, I'm using ckeditor to allow users to create individual pages. While testing some parts of it, I came across this feature that's sort of driving me nuts. I searched the forum and found a thread that mentioned there are other threads relating to this question, but I wasn't able to actually find these posts. I'm sorry if this is a repeat and have been answered before.

Here's the description: If I try to save this page, which was created in ckeditor:
Code:
<div id="content">
    <h2>
        &nbsp; Page heading</h2>
    <p>
        Vel illum dolore eu feugiat nulla facilisis.<img alt="Angry face" src="info.png" /></p>
</div>
I get a "Disallowed Key Characters" error. After googling, I found the hint to output the offending characters, but unfortunately, they mean nothing to me:
Code:
nbsp;_Page_heading</h2>
    <p>
        Vel_illum_dolore_eu_feugiat_nulla_facilisis_<img_alt
Could anyone help? Thank you in advance for your help.

PS: I'm not using the ckeditor plugin to start ckeditor. Just javascript and
Code:
$('#textarea_html').ckeditor({height:400,skin:"v2"});

Edit: I think I should also mention I'm using this form with jquery ajax with 'type: "POST"'. I read you can use urlencode() to fix this error, but I'm not sure where to use decode().


ckeditor causes "Disallowed Key Characters" error. - El Forum - 07-31-2011

[eluser]tomyt[/eluser]
Hit a brainwave after posting this: and figured out what to search for in google.

Get the value of ckeditor:
Code:
var html = $("#textarea_html").val();
And when posting, escape() the actual data when passing it to jquery ajax submit:
Code:
var dataString = 'html='+ escape(html);