Welcome Guest, Not a member yet? Register   Sign In
ckeditor causes "Disallowed Key Characters" error.
#1

[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().
#2

[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);




Theme © iAndrew 2016 - Forum software by © MyBB