This works in IE7 and Safari, but not for Firefox. If it does work for Firefox it is intermittent. After the first time all other attempts fail, even when leaving and re-entering the page.
In this particular case I am trying to reset the form to a blank state using a function called by an onclick event of the button.
What I get back is:
I've played with this using SetHTML() and it does the exact same thing.
What is interesting is that the first one (header_txt) works. It's the second that dies.
I've seen others with similar problems, but can never find a concrete answer for this.
Can we get something definitive?
Thanks,
Cy
In this particular case I am trying to reset the form to a blank state using a function called by an onclick event of the button.
var oEditor = FCKeditorAPI.GetInstance("header_txt"); var oEditor2 = FCKeditorAPI.GetInstance("footer_txt"); oEditor.SetData(""); oEditor2.SetData("");
What I get back is:
Error: oEditor2 is undefined
I've played with this using SetHTML() and it does the exact same thing.
What is interesting is that the first one (header_txt) works. It's the second that dies.
I've seen others with similar problems, but can never find a concrete answer for this.
Can we get something definitive?
Thanks,
Cy
Re: Firefox 3 and instance vars
Re: Firefox 3 and instance vars
No sure how much more definitive I can be given the code above, and that it is in a function that is fired off by a onclick from a button.
If you:
create two instances of the editor
then have it load on the page with something already in the editors
then in Firefox 3 try to clear them by the onclick function you will see what I mean.
Apart from trying to put something on the web, this is all you need to see the that is just isn't working in Firefox 3.
Re: Firefox 3 and instance vars
Re: Firefox 3 and instance vars
Please go to http://www.cyberjobes.com/fckBroke/ and view in Firefox 3.
Thanks in advance for your help.
Cy
Re: Firefox 3 and instance vars
Any clues?
Re: Firefox 3 and instance vars
Anyone else getting an error?
The error only seems to happen on my DEV machine in Firefox and Safari for windows/
Could it be my server?
Re: Firefox 3 and instance vars
Some people have reported some similar problems, but so far I haven't seen a test case that can be used to understand it and fix the problem.
Re: Firefox 3 and instance vars
I have two instances of fck editors and I wanted to clear one of them using javascript. So I used "FCKeditorAPI.GetInstance" function to obtain the instance object and clear it. But strangely the clear function I wrote doesn't work constantly ( It works some times but when I refresh the page it didn't and after I do few more refreshing it works )
The reason for this was GetInstance function return null value sometimes.
So I used following function to see what was going on
And what I found was if the instance I need to clear initialize first the GetInstance function will return an object but if it initialize second the GetInstance function will return a null value.
so as a solution for my problem I am using "FCKeditor_OnComplete" function to obtain the instance object that need to get cleared. Following are the code.
Hope this would help.
Re: Firefox 3 and instance vars
Re: Firefox 3 and instance vars
Re: Firefox 3 and instance vars
If you want a solution you must provide a testcase that fails. If we can't reproduce the problem we can't fix it.
Re: Firefox 3 and instance vars
I'm also having this problem with firefox 3 and 2 instances of fckeditor. I'm testing my website using http://localhost but also happens on the uploaded website. I also check with firebug and notice that in the FCKEditorAPI var, the second instance is not registered, only the first one.

Also when sending the form via javascript (form.submit()) doesn't send the value of the second field. Just as is described in this bug report http://dev.fckeditor.net/ticket/2519
Sorry can't provide a working example. I'm busy looking for a workaround. maybe later
P.S. sorry for so many "Also".
Re: Firefox 3 and instance vars
Now I'm looking more at this as being more of a problem with the version of FCKEditor, since the only thing outside of the browser (firefox) that has changed is the version of FCKEditor I am using.
It's really weird too. Once I changed the script to clear only one editor, and it worked.
But, change the name to oEditor2 and it will break.
I don't understand that when all I did was change then name of the variable. I should be able to give the variable any name and it should work regardless.
Makes me wonder if there is something accidentally hard coded. Just a guess, I grasping here because I'm at a loss as to what in the world would cause this or why.
Re: Firefox 3 and instance vars
The idea was to give each editor it's own clear button. Keep in mind that I have two editors on the page.
The code for each button is similar to the code below. the only change if the text shown by the button, and the instance name in the function call for the appropriate editor.
The function looks like this:
The result was the same. I tried each editor and in all cases the second editor, no matter what order, would not clear and drew the error
I hope there is an answer to this soon. My time spent on this is costing me.
Many thanks for any help given.
Cy
EDIT: BTW - I tested my theory of the version of FCKEditor by throwing in the older version that worked before. In Firefox 3 it broke just the same. There is no issue with the version.