Hi everybody
I want to use ckeditor.
But I have a problem with CKEDITOR.replace
I specify that I was loading page with AJAX.
First I created a textarea element that name ise _Text
Everything is normal.
Then I've used
After All That I saw alert number 1 and I got a message
[CKEDITOR.editor.replace] The element with id or name "_Text" was not found.
and the end,
I did not see alert message number 2
What is the problem my friend?
Why does my editor load?
Thanks
Respectfully yours.
I want to use ckeditor.
But I have a problem with CKEDITOR.replace
I specify that I was loading page with AJAX.
First I created a textarea element that name ise _Text
<textarea name="_Text" id ="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">d</textarea>
Everything is normal.
Then I've used
alert('1');
CKEDITOR.editor.replace('_Text', { toolbar : [
['Bold','Italic','Font','FontSize'] ] });
alert('2'); After All That I saw alert number 1 and I got a message
[CKEDITOR.editor.replace] The element with id or name "_Text" was not found.
and the end,
I did not see alert message number 2
What is the problem my friend?
Why does my editor load?
Thanks
Respectfully yours.

Re: CKEDITOR.replace is not work
So, show the code please how you create textarea element after loading.
Re: CKEDITOR.replace is not work
<td colspan=2> <script type='text/javascript'> alert(1); CKEDITOR.replace('_Text', { toolbar : [ ['Bold','Italic','Font','FontSize'] ] }); CKEDITOR.instances[ '_Text' ]; alert(2); </script> <textarea name="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">Example</textarea> </td>this code loading with ajax from another php file
I dont understand what is the problem?
What is the meaning of this error?
[CKEDITOR.editor.replace] The element with id or name "_Text" was not found.
Thanks
Re: CKEDITOR.replace is not work
I added onfocus event of textarea element.
<textarea name="_Text" id="_Text" style="border: 1px solid gray; width: 600px; height: 250px;" onfocus="CKEDITOR.editor.replace('_Text', { toolbar : [['Bold','Italic','Font','FontSize'] ] });" >Example</textarea>After User clicked textarea element.Editor is loaded.
Now I understand CKEDITOR.editor.replace code is not loaded.
I must loaded the CKEDITOR.editor.replace code.
But I dont know how?
I chechk firebug.There is no code about javascript.
So
I write this code
<td colspan=2> <script type='text/javascript'> alert(1); CKEDITOR.replace('_Text', { toolbar : [ ['Bold','Italic','Font','FontSize'] ] }); alert(2); </script> <textarea name="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">Example</textarea> </td>But it's seems like that
How do I load CKEDITOR.replace ?
Thanks.
Re: CKEDITOR.replace is not work
Concerning to this one:
<td colspan=2> <script type='text/javascript'> alert(1); CKEDITOR.replace('_Text', { toolbar : [ ['Bold','Italic','Font','FontSize'] ] }); alert(2); </script> <textarea name="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">Example</textarea> </td>and the error "[CKEDITOR.editor.replace] The element with id or name "_Text" was not found.", it means that you were trying to replace textare which hadn't been added to DOM yet.You can try this one:
<td colspan=2> <textarea name="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">Example</textarea> <script type='text/javascript'> alert(1); CKEDITOR.replace('_Text', { toolbar : [ ['Bold','Italic','Font','FontSize'] ] }); alert(2); </script> </td>If it doesn't help I still need what I asked above.Re: CKEDITOR.replace is not work
CKEditor works with the ID attribute.
Try this:
<td colspan=2> <textarea name="_Text" id="_Text" style="border: 1px solid gray; width: 600px; height: 250px;">Example</textarea> <script type='text/javascript'> CKEDITOR.replace('_Text', { toolbar : [ ['Bold','Italic','Font','FontSize'] ] }); </script> </td>