How do you rebind an editor instance with the javascript api?
What I have right now is a PHP page with a form including a textarea, along with a select box and a few other inputs. When the page loads initially, I bind the editor with javascript as per the documentation, and it works great and is exactly what I want. When the select box changes it reloads the form with data from a database, but obviously since the original textarea object doesn't exist in the DOM anymore the editor breaks.
So, I have the new textarea content...how do I go about rebinding the instance? I've tried creating new instances over the top of the new textarea once it is loaded and the editor doesn't seem to want to show up.
Any ideas?
What I have right now is a PHP page with a form including a textarea, along with a select box and a few other inputs. When the page loads initially, I bind the editor with javascript as per the documentation, and it works great and is exactly what I want. When the select box changes it reloads the form with data from a database, but obviously since the original textarea object doesn't exist in the DOM anymore the editor breaks.
So, I have the new textarea content...how do I go about rebinding the instance? I've tried creating new instances over the top of the new textarea once it is loaded and the editor doesn't seem to want to show up.
Any ideas?
Re: Rebinding editor instance
hmmm I'm not aware of any binding methods? where in the docs did you see this?
Can't you just replace the editor's content with SetData(html) (see http://docs.fckeditor.net/FCKeditor_2.x ... Script_API) instead of recreating the editor?
(I believe SetData( html ) replaces the content in the editor, where SetHTML( html ) adds content)