Because the FCKeditor tag does not support some html events, how to directly use js to obtain the value of the event is as follows:
It becomes a problem.
Idea: Use the js function automatically loaded by Fckeditor on the page containing FCKeditor to pass the modified value of the obtained content to a hidden, and then use js on the parent page to obtain the value of hidden, form submission
Iframe page:
Java code
<Script type = "text/javascript">
// FCK automatically loads this function
Function FCKeditor_OnComplete (editorInstance ){
EditorInstance. Events. AttachEvent ('onblur', checkTextValue );
}
// Check the input box
Function checkTextValue (){
Var introducevalue = FCKeditorAPI. GetInstance ("EditorDefault"). EditorDocument. body. innerText;
// Alert (introducevalue );
Document. getElementById ("hidden"). value = introducevalue;
If (introducevalue = ""){
Alert ("content cannot be blank ");
}
}
</Script>
Parent page;
<Script type = "text/javascript">
Function check ()
{
Alert (window. frames ["qq" ].doc ument. getElementById ("hidden"). innerHTML );
}
</Script>
Author "diligence"