I'm trying to append text to the editor on click of a button.
After finding site below, I thought this would of been straight forward and very easy to do, I'm still stuck.
http://docs.cksource.com/ckeditor_api/s ... insertHtml
Here is my javascript
<script type="text/javascript"> function s1appendtext() { var grid = "[COLS" + document.getElementById('<%= txtcols1.ClientID %>').value + "x" + document.getElementById('<%= txtrows1.ClientID %>').value + "]"; CKEDITOR.instances.s1_CKEditor.insertText(grid); } </script>
Re: How to Append Text to Editor
Do you get any error?
Re: How to Append Text to Editor
I've tried playing around with the syntax, but unfortunately unable to figure this out. Do you or anyone have any idea what I'm doing wrong?
Re: How to Append Text to Editor
Re: How to Append Text to Editor
You can check the contents of CKEDITOR.instances to check that.
Re: How to Append Text to Editor
Can you explain how I can correctly check the contents of CKEDITOR.instances. Using IE9 developer tool I was able to drill down to CKEDITOR.instances but I was not 100% sure of what I was looking at.
Re: How to Append Text to Editor
That worked. If anybody has an issue with this
Using IE 9
I added a watch to CKEDITOR
View it instances
FireFox.
The same can be done with Firebug
Thanks again
alfonsoml
Attachments:
Re: How to Append Text to Editor
Re: How to Append Text to Editor
Thanks alfonsoml
I agree - I really don't what to hard code what I think the control is going to be renamed to. Asp.net does have client Id, but it still can be changed unless you set the ClientIDMode to static, which I think by default it is set to inherit (no sure).
This is what I've done
changed
to this
then changed the javascript from
to this
if you notice the browser changes the the control name to "MainContent__~~~~" if I set the client mode to static the browser does not change the control name.
Thanks again for your help and pointing me into the right direction. I will do some more testing.