Hello,
I try to get FCKeditor running in my CMS. I've encountered problems with javascript: I tried to use the ReplaceTextarea() method, but I recognized I cannot use the content of the id tag - I had to use name's content since fckeditor.js uses "byName":
FCKeditor.prototype.ReplaceTextarea = function()
{
[..]
var oTextarea = document.getElementsByName( this.InstanceName )[0] ;
[..]
}
my html:
<textarea id="ernie" name="bert">content</textarea>
my js script:
<script type="text/javascript" src="./FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
var sBasePath = "./FCKeditor/";
var editor = new FCKeditor('bert') ;
editor.BasePath = sBasePath ;
editor.ReplaceTextarea();
</script>
But still I do get js errors in my firefox 1.0 on my Mac:
Error: FCK.LinkedField has no properties
Source File: http://[..]/FCKeditor/editor/js/fckeditorcode_gecko_1.js
Line: 17
BUT if I use the php example directly it works immedietly and creates a hidden form element with identical name and id content!?
<input type="hidden" name="bert" id="bert" [..]
Do I have to use the same content in name and id? I do need different content!
ps. If I do another new editor and Create() after the first failed 'ReplacedTextarea()'-Editor both editor are working well!
Thu, 03/03/2005 - 09:30
#1
RE: ReplaceTextarea() - id or name
var oTextarea = document.getElementsByName( this.InstanceName )[0];
by
var oTextarea = document.getElementById( this.InstanceName ) ;
Does this could have any side effect?
RE: ReplaceTextarea() - id or name
problem solved very nice in 2.0RC3 - thank you