The CKEditor Editor is an upgraded version of FCKeditor
Think for FCK, it is really easy to use, loading speed is also relatively fast
The following is for form validation if you get the value of the CKEditor editor through JS
if (CKEDITOR.instances.content.getData () = = "") {
Alert ("Content cannot be empty!") ");
return false;
}
Content is the name of textarea
Next time the CKEditor configuration and upload configuration, I only get PHP upload
Just a friend of the response that Firefox can not be judged empty, I slightly modified the next
My test in FF passed, the following is the JS code
function Trim (str) {
Return Str.replace (/(^/s*) | ( /s*$)/g, "");
}//Remove Space
var str=ckeditor.instances.content.getdata ();
Str=str.replace ("<br/>", "");
Str=str.replace ("<br>", "");
Str=trim (str);
if (str== "") {
Alert ("Content cannot be empty!") ");
return false;
}
Specifically in the use of the combination, thank the friend of the proposed
/*
***************************************************************************/
The eval () function computes a string and executes the JavaScript code in it. (A very important function)
var cke_arr = ckeditor.instances;
Eval ("var cke_content = ckeditor.instances.") +ta_id+ ". GetData ();");