Hi there,
I'm currently working on a piece of code to count (and display) the number of characters entered in the editor. I've already found a function that counts the number of 'real' characters, so without the html-elements, which works great. The script obviously needs an event to activate it, so currently i've placed it under a button that pops up the result of the count.
However, to get the script to react on the input of the user i want to move it to the 'onkeyup'-event. This is where the problem comes in: i cant find the appropriate element in the FCKeditor in which i can implement the onkeyup-event. The only things i can find are either tables or iframes that seem to get replaced in the end, which makes my code disappear.
In what element should i place the onkeyup-event so that it's being used by the FCKeditor?
I'm currently working on a piece of code to count (and display) the number of characters entered in the editor. I've already found a function that counts the number of 'real' characters, so without the html-elements, which works great. The script obviously needs an event to activate it, so currently i've placed it under a button that pops up the result of the count.
However, to get the script to react on the input of the user i want to move it to the 'onkeyup'-event. This is where the problem comes in: i cant find the appropriate element in the FCKeditor in which i can implement the onkeyup-event. The only things i can find are either tables or iframes that seem to get replaced in the end, which makes my code disappear.
In what element should i place the onkeyup-event so that it's being used by the FCKeditor?
Re: Active character count for FCKeditor
I know this problem can be found all over the internet, but -none- of the topics (including this one ) provide a solution for the problem. If I overlooked something, please tell me, or post a link to a topic/page that does have the solution.
Re: Active character count for FCKeditor
Just look how the other characters counting plugins have done it: http://sourceforge.net/tracker/?group_i ... tid=737639
Re: Active character count for FCKeditor
iam sending for onkeyup event in fckeditor, place this code in oncomplete function
if (document.all) {
// IE
editorInstance.EditorDocument.attachEvent("onkeyup", DoSomething) ;
} else {
// other browser
editorInstance.EditorDocument.addEventListener( 'keyup', DoSomething, true ) ;
}
you can get easily,
Re: Active character count for FCKeditor
I guess i must replace keyword editorInstance with the name of my fckeditor instance. Is EditorDocument to be replaced too ?
Re: Active character count for FCKeditor
function FCKeditor_OnComplete( editorInstance )
{
if (document.all) {
// IE
editorInstance.EditorDocument.attachEvent("onkeyup", DoSomething) ;
} else {
// other browser
editorInstance.EditorDocument.addEventListener( 'keyup', DoSomething, true ) ;
}
}