CKeditor editor is an upgraded version of FCKeditor
For FCK, it is indeed easier to use and the loading speed is faster
The following is the value of CKeditor editor obtained through JS for form verification
if(CKEDITOR.instances.content.getData()==""){
alert("Content cannot be empty!");
return false;
}
content is the name of the textarea
Next time I will post the CKeditor configuration and upload configuration. I only uploaded it in PHP
A friend just reported that it cannot be judged as empty under FIREFOX. I modified it slightly
My test passed under FF. The following is the JS code
function trim(str){
return str.replace(/(^/s*)|(/s*$)/g,"");
}//Remove spaces
var str=CKEDITOR.instances.content.getData();
str=str.replace("
","");
str=str.replace("
","");
str=trim(str) ;
if(str==""){
alert("Content cannot be empty!");
return false;
}
The specific combination is in use. Thank you to this friend for suggesting it
/*
**************************************************** ******************************/
Theeval() function evaluates a string and executes the JavaScript code within it. (A very important function)
var cke_arr = CKEDITOR.instances;
eval("var cke_content = CKEDITOR.instances." ta_id ".getData();");